Base64 Image Extractor - Online Download from Data URI
Paste a Base64 data URI and download the image directly. Supports JPEG, PNG, GIF, WebP. Safe local processing.
UD5 Toolkit
Real-time monitoring of XHR & Fetch upload progress with live speed, ETA, and detailed logs
Drag & drop a file here
Tap to select or drop file
or click to browse files
Max 50MB for real upload Β· Any size for simulation
function xhrUploadWithProgress(url, file, onProgress) {
return new Promise((resolve, reject) => {
const xhr = new XMLHttpRequest();
// Track upload progress via xhr.upload
xhr.upload.addEventListener('progress', (e) => {
if (e.lengthComputable) {
onProgress(e.loaded, e.total);
}
});
xhr.addEventListener('load', () => {
if (xhr.status >= 200 && xhr.status < 300) resolve(xhr);
else reject(new Error(`HTTP ${xhr.status}`));
});
xhr.addEventListener('error', () => reject(new Error('Network error')));
xhr.addEventListener('abort', () => reject(new Error('Upload aborted')));
xhr.open('POST', url);
xhr.send(file); // Native progress events fire automatically
});
}
// Fetch API has NO native upload progress events.
// We wrap the file stream with ReadableStream to track bytes sent.
async function fetchUploadWithProgress(url, file, onProgress, signal) {
const fileStream = file.stream();
const reader = fileStream.getReader();
let uploaded = 0;
const trackingStream = new ReadableStream({
async pull(controller) {
const { done, value } = await reader.read();
if (done) { controller.close(); return; }
uploaded += value.byteLength;
onProgress(uploaded, file.size);
controller.enqueue(value);
}
});
const response = await fetch(url, {
method: 'POST',
body: trackingStream,
duplex: 'half', // Required for streaming body
signal,
headers: {
'Content-Type': file.type || 'application/octet-stream',
'Content-Length': String(file.size),
}
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
return response;
}
progress events on xhr.upload, fetch treats the request body as a stream. To track upload progress, you need to wrap the body stream with a ReadableStream and count bytes as they are read β this is the modern, composable approach. Browser vendors opted for stream-based APIs over event-based ones for greater flexibility.
duplex: 'half' and why is it required?
duplex: 'half' tells the browser that the request body is a half-duplex stream β data flows in one direction (client β server). This is required when using a ReadableStream as the fetch body. Without it, the browser will throw a TypeError. This option was introduced to support streaming request bodies while maintaining backward compatibility. It's supported in Chrome 105+, Firefox 120+, Safari 17+, and Edge 105+.
xhr.upload.onprogress event is supported in all browsers and gives accurate, real-time progress data. Fetch with ReadableStream wrapping is the modern equivalent but requires newer browser APIs. For production applications targeting all browsers, XHR remains the safer choice. For modern SPAs, the Fetch + ReadableStream pattern works well with proper feature detection.
xhr.abort() β this triggers the abort event. For Fetch, create an AbortController, pass its signal to the fetch options, and call controller.abort() to cancel. When using ReadableStream for upload tracking, the stream's pull() method will stop being called after cancellation. Both methods cleanly terminate the upload.
speed = deltaBytes / deltaTime. This provides a smooth, responsive speed reading that adapts to network fluctuations without excessive jitter. ETA is then derived as remainingBytes / currentSpeed.
pull() is called once, reads the whole file, and progress jumps from 0% to 100% instantly. This is expected behavior. For meaningful progress tracking, files should be at least a few hundred KB. Use the simulation mode in this tool to see granular progress with any file size.
xhr.upload.onprogress. In Fetch, wrap the request body stream. Download progress tracks data received from server to client (response body). In XHR, use xhr.onprogress. In Fetch, read response.body.getReader() and count bytes. These are separate concerns β don't confuse them!
FormData for multipart uploads?
FormData, the browser constructs the multipart body internally. You cannot easily wrap it with a ReadableStream for progress tracking. The best approach is to either: (a) use XHR with FormData (native progress events work), or (b) construct the multipart body manually as a Blob or stream. For simple file uploads, sending the raw file with Content-Type is simpler and fully trackable.
Paste a Base64 data URI and download the image directly. Supports JPEG, PNG, GIF, WebP. Safe local processing.
Create and dispatch custom events with detail. Listen on other elements. Understand pub/sub pattern in vanilla JS.
Decode an image progressively using the ImageDecoder API. See partial results and metadata. Modern alternative to <img>.
Paste HTML and extract all unique dataβ* attributes into a clean list. Understand the data model of a page.
Upload a WebP image and automatically generate a <picture> tag with JPEG/PNG fallback. Ensure compatibility everywhere.
Decode Base64 encoded strings back into viewable images and download them as PNG. Useful for debugging APIs and data URIs. Secure local processing.
Connect a MIDI controller and see every message in a log. Filter by channel and type. Essential for debugging music apps.
View recent earthquakes worldwide on a map. Fetches public USGS GeoJSON feed directly from browser. Real-time data.
Start a fetch request and cancel it with AbortController. See how to implement request cancellation. Interactive.
Write or paste an HTML snippet and generate a PDF using the browser's print engine. Customize page size and margins.
Turn any photo into a beautiful kaleidoscope pattern by reflecting and rotating segments. Adjust parameters.
Enter RGB values row by row and create a tiny BMP file. Understanding bitmap headers. Geeky developer tool.
Transform any image into a Base64 data URI for embedding directly into HTML, CSS, or JSON. Drag and drop support. Entirely browser-side conversion.
Paste lyrics and tap while the song plays to embed timestamps. Export as .lrc file for music players. All in browser.
Realβtime frequency spectrum from your microphone. Visual bars or line. Check room resonance.
Enter a URL to see exactly what Open Graph and Twitter card tags will be shown when shared on social media. Fetch from browser.
Paste XML sitemap content and extract all <loc> URLs into a clean list. Useful for auditing. Local parsing only.
Add a realistic water ripple or heat haze distortion to your image. Download the warped photo. Canvas manipulation.
Upload an image and see its 2D FFT magnitude and phase. Learn how image filtering works. Educatinal tool. Canvas.
Parse a Snowflake ID (used by Discord, Twitter) into its timestamp, worker, and sequence components. Instant local decoding.
Combine multiple static images into a single animated GIF. Adjust frame delay and order. No upload, inβbrowser encoding.
Apply tone mapping algorithms to bring out details in highlights and shadows. Simulate HDR from a single image.
Remove all EXIF data (GPS, camera info) from a JPEG before uploading. Processed locally. Protect your privacy.
Generate a standard XML sitemap for your website by entering a start URL. Crawls internal links directly from your browser. No server-side processing.
Connect your MIDI keyboard and see pressed notes visually on a piano roll. Check velocity, channel, and aftertouch. No DAW needed.
Write Mermaid markdown and instantly see the rendered flowchart, sequence diagram, or Gantt chart. Copy SVG output. Browser-side rendering.
Decode FLAC, Opus, or OGG audio files in the browser using compiled WASM libraries. Play instantly without server uploads. Keep audio private.
Build a vertical timeline by entering events with dates and descriptions. Export as image or HTML. Perfect for project milestones.
Convert a JSON array of strings or numbers into a singleβcolumn CSV. Quick data dump. Local.
Add a dramatic fire or flame overlay to any image. Realistic blending. Adjust intensity. Download the hot result.