CSS Data URI Converter

Inline the images your CSS references as data URIs. Paste a stylesheet (or drop the .css file), drop the images it uses, and every url() that matches an uploaded file by name is replaced — SVGs URL-encoded for size, everything else as Base64. Files over your size limit and references you didn't upload are left alone and listed. It's free, runs in your browser, and nothing is fetched or uploaded.

Encoding by file type

FileEncoded asGrowth
SVGURL-encodedUsually small
PNG, JPG, GIF, WebPBase64About +33%
WOFF2 / WOFF fontsBase64About +33%

When to use it

  1. Make a single self-contained CSS file for an email or widget.
  2. Remove extra requests for tiny icons and patterns.
  3. Bundle a theme into one file for a CMS that won't host images.
  4. Inline small fonts for an offline or embedded page.

How to Use

  1. Paste your CSS or drop the .css file.
  2. Drop the images (and fonts) it references.
  3. Set the size limit.
  4. Check the report and copy or download the CSS.

Features

  1. Matches url() by file name
  2. Never fetches remote files
  3. Size limit for inlining
  4. URL-encoded SVG
  5. Before/after size report
  6. 100% client-side

FAQs

How are images matched to url() references?

By file name. url(img/icons/star.png) matches an uploaded star.png, whatever folder it came from.

Does it download images from the web?

No. Only files you drop in are used; other references stay as links and are listed.

Why are SVGs not Base64-encoded?

URL-encoding keeps SVG mostly readable, is usually smaller, and compresses better.

Should I inline every image?

No. Inline small ones; big images make the CSS heavy and can't be cached on their own. That's what the size limit is for.

Are my files uploaded?

No. Everything happens in your browser.

Technical Details

The converter finds every url() in the stylesheet — quoted or not, with query strings and hash fragments — and matches each to an uploaded file by its file name, ignoring the path. A matching file is replaced with a data URI; references with no matching upload are left exactly as written and listed, and nothing is ever fetched from the network, so the result only contains files you provided. A size limit, 10 KB by default, leaves larger files as normal links, because inlining grows them by a third and stops them being cached separately. SVGs are URL-encoded rather than Base64-encoded: only the handful of characters that break a URL are escaped and double quotes become single ones, which is typically smaller and compresses far better with gzip or Brotli. The report shows how many references were inlined, skipped for size or left unmatched, and the stylesheet's size before and after. Fonts can be inlined the same way.

Developer Tools

Developer Tools

  • Basic Auth Header Generator
  • Hex Dump Viewer
  • Text Encoding Inspector
  • Punycode Converter
  • Email Obfuscator
  • UUID Validator
  • ULID Generator
  • SemVer Compare