Scrawlspace › Image Tools
Image to Base64 Converter Drop or paste an image to get its Base64 string or a ready-to-use data URI, plus copy-ready CSS, HTML and Markdown snippets. The image is read on your device and never uploaded.
How to use Image to Base64 Drop an image here, choose a file, or paste one with Ctrl+V. Pick the Output: Data URI, Base64, CSS, <img> or Markdown. Check how much larger the encoded version is. Click Copy to put it on your clipboard. Frequently asked questions How do I convert an image to Base64? Drop the image here and the Base64 text appears straight away. Choose Base64 for the raw string or Data URI for a value you can use in src or url().
When should I embed images as Base64? It suits small icons in CSS and single-file HTML pages, because it saves a separate request. For anything over about 10 KB it's usually better to link the file: Base64 is about a third bigger and can't be cached separately.
Can I use Base64 images in email? Not reliably. Gmail and many versions of Outlook don't display data-URI images in HTML email. Host the image and link it, or attach it, instead.
What does a data URI look like? data:image/png;base64, followed by the Base64 text. The part before the comma names the image type, so browsers know how to show it.
How do I turn Base64 back into an image? Use Base64 to Image . To encode or decode text rather than images, use Encode / Decode .
Is my image uploaded? No. The image is read and encoded in your browser.
Output formats Output What you get Use it in Data URI data:image/…;base64,… An img src, a CSS url() or JSON Base64 The encoded bytes only APIs and databases that store the type separately CSS background-image: url(data:…) A stylesheet <img> A complete img tag HTML pages Markdown  Markdown editors that allow data URIs
When not to inline an image Large photos: the page's HTML or CSS grows by a third more than the image, and it downloads again on every page that includes it. Images used on many pages: a separate file is cached once. Email: many clients block data URIs. SVG icons: a URL-encoded SVG data URI is often smaller than Base64. Shrink the SVG first with the SVG optimizer . Related tools Base64 to Image : Paste Base64 or a data URI to preview the image and download it.Encode / Decode : Base64, Base64URL, URL, HTML entities, Unicode escapes and hex, both ways, as you type.SVG Optimizer : Minify SVGs with SVGO and compare the result side by side.Image Compressor : Shrink JPEG, PNG, WebP and AVIF files in bulk, with a before/after comparison.All tools Board : Hand-drawn whiteboard with live to-do, code, table and API cards. Multiplayer and encrypted.Diff Checker : Compare two texts or files side by side. Line and word highlights, JSON mode, ignore whitespace, export a patch.JSON Viewer : Paste JSON to validate, format, minify and explore it as a collapsible tree.CSS Formatter : Beautify messy CSS or minify it for production. Handles nesting, @media and comments.Developer Utilities : JWT decoder, Base64/URL/HTML encoder, hashes, UUID/ULID and password generators, timestamp converter, cron explainer and what's my IP.PDF Tools : Edit and sign, merge, split, compress, convert (Word, Excel, PowerPoint, JPG), OCR, protect, unlock, redact and compare PDFs. Files stay on your device.Image Tools : Compress, resize, crop and convert (HEIC to JPG, WebP, AVIF, Base64). Optimise and render SVGs. Generate QR codes, favicons and OG images.Image Compressor : Shrink JPEG, PNG, WebP and AVIF files in bulk, with a before/after comparison.Image Resizer : Resize by pixels, percentage or presets for Instagram, YouTube, passport photos and more. Pick the output format.Image Cropper : Crop freely or to 1:1, 16:9 and other ratios. Rotate and flip too.Remove Background : Cut out a person or object for a transparent PNG, or put it on white or blue for passport and exam photos. Runs on your device.Compress Image to 20KB : Get photos and signatures under 20 KB for online forms. Quality drops first, then size, only as much as needed.Compress Image to 50KB : Shrink JPG and PNG images to under 50 KB for application forms and uploads with a size limit.Compress Image to 100KB : Make any photo 100 KB or smaller, in bulk, while keeping it as sharp as the limit allows.Compress Image to 200KB : Reduce photos to under 200 KB for email, websites and upload forms, with a before/after view.Passport Size Photo : Crop and resize a photo to 35×45 mm at 300 dpi (India, UK, EU). US 2×2 in and other sizes are a click away.Exam Photo & Signature Size : Official photo and signature sizes for SSC, UPSC, IBPS, NEET, JEE, CUET and PAN, and a compressor set to 20–50 KB.YouTube Thumbnail Resizer : Fit any image to YouTube's 1280×720 thumbnail size, cropped to fill and centred.Instagram Post Resizer : Resize photos to Instagram's 1080×1080 square post, or switch to 4:5 portrait or story size.HEIC to JPG : Convert iPhone HEIC and HEIF photos to JPG in bulk. Nothing is uploaded.Image to WebP : Convert JPEG, PNG, GIF and SVG to WebP in bulk. Keeps transparency.Image to AVIF : Convert images to AVIF, usually the smallest format browsers support.Image to Base64 : Turn an image into a data URI with CSS, HTML and Markdown snippets.Base64 to Image : Paste Base64 or a data URI to preview the image and download it.PNG to JPG : Convert PNG images to JPG in bulk. Transparent areas become white.JPG to PNG : Convert JPG photos to lossless PNG in bulk, with no further quality loss.WebP to JPG : Turn WebP images into JPGs that open in every app. Convert many at once.WebP to PNG : Convert WebP images to PNG and keep their transparency.AVIF to JPG : Convert AVIF images to widely supported JPG files, in bulk.HEIC to PNG : Convert iPhone HEIC photos to lossless PNG. Nothing is uploaded.SVG Optimizer : Minify SVGs with SVGO and compare the result side by side.SVG to PNG : Render an SVG to PNG, JPEG, WebP or AVIF at any scale.SVG Viewer : Edit SVG code with a live, zoomable preview on light, dark or transparent backgrounds.Favicon Generator : Make favicon.ico, Apple and Android icons and a web manifest from an image or text.QR Code Generator : QR codes for links, Wi-Fi, contacts, email, phone and text. Colours, dot styles and a logo; PNG or SVG.OG Image Generator : Design 1200×630 social preview images for links, with the meta tags to match.Text Tools : Count words and characters (Hindi too) against a character limit, and convert text to UPPER, Title, camelCase, snake_case and more.Calculators : Age on any date, percentages, GST and marks, and a unit converter with sq ft, gaj, acre, guntha and KB vs KiB.What's new About Privacy