DevTools Surf logoDevTools Surf
AI / Modern DevAnimation / CSSAPI / Config
Sign in
DevTools Surf logoDevTools Surf
AI / Modern DevAnimation / CSSAPI / Config
Sign in
HomeGeneratorsData URI Generator

About Data URI Generator

Data URI Generator preview - Generators tool

Wrap any text (or file contents) into a base64 data: URI. Part of the DevTools Surf developer suite. Browse more tools in the Generators collection.

Use Cases

  • Frontend devs inlining small icons to reduce HTTP requests
  • Email template builders embedding images that survive forwarding
  • CSS authors embedding SVG backgrounds without external files
  • Single-page app devs bundling tiny assets into JavaScript

Tips

  • Inline small icons as data URIs to eliminate HTTP requests
  • Keep data URIs under 32KB for optimal browser performance
  • Use for embedding SVGs directly in CSS background-image

Fun Facts

  • The data: URI scheme was formally defined in RFC 2397, published in August 1998 by Larry Masinter at Xerox PARC.
  • Internet Explorer did not support data URIs until version 8 (2009), and even then limited them to 32KB — a restriction that persisted for years.
  • A base64-encoded data URI is approximately 33% larger than the original binary file because base64 encodes every 3 bytes as 4 ASCII characters.

FAQ

What data can I embed?
Text (CSS, HTML, SVG, JavaScript) and file contents. Output is a `data:` URI that you can paste into an `<img src>`, CSS `background: url(...)`, or anywhere a URL is expected.
Is base64 always needed?
For binary yes. For text with printable ASCII only, toggle off — URL-encoded (non-base64) data URIs are smaller for text content like SVG.
How does this compare to external files?
Smaller HTTP request count (no separate fetch), but base64 overhead (~33% larger). Good for small icons and one-off embeds; bad for large files.
Do data URIs work in emails?
Most email clients strip or block them. For email images use attached CID references or hosted URLs. Data URIs are a web-only technique in practice.

Related Generators Tools

UUID GeneratorULID GeneratorPassword GeneratorcURL to CodeCron Expression ParserSQL FormatterGraphQL FormatterJSON Schema Generator
New · Flagshipsimple REST client

REST Handler — Collections, env vars, history, cURL converter

Send requests, save collections (nested), swap environments, and convert between cURL / Collection JSON / REST Handler YAML.

Open

Popular tools

The most-used tools on DevToolsSurf, one click away.

Encoding & crypto

  • Base64 Encode
  • Base64 Decode
  • URL Encoder
  • URL Decoder
  • Hash Generator
  • JWT Decoder
  • JWT Encoder
  • UUID Generator
  • ULID Generator
  • Password Generator
  • Bcrypt Hash Tester

Converters

  • CSV to JSON
  • JSON to CSV
  • XML to JSON
  • JSON to XML
  • HTML → Markdown
  • HTML → React JSX
  • cURL to Code
  • Collection JSON → cURL
  • Swagger to Collection JSON
  • JSON → Go Struct
  • JSON → TypeScript Types

JSON & YAML

  • JSON Formatter
  • JSON Validator
  • JSON Viewer
  • JSON Minifier
  • JSON Diff
  • JSONPath Tester
  • YAML Formatter
  • YAML to JSON
  • JSON to YAML

Text & regex

  • Regex Tester
  • Text Diff
  • Case Converter
  • Word Counter
  • Markdown Preview
  • Slug Generator
  • Lorem Ipsum Generator
  • Markdown → PDF

CSS & color

  • CSS Beautifier
  • Minify CSS
  • Color Converter
  • Gradient Generator
  • Contrast Checker
  • Color Palette Generator
  • Flexbox Playground
  • Tailwind → CSS

Generators

  • QR Code Generator
  • Mock Data Generator
  • Favicon Generator
  • .gitignore Builder
  • README.md Generator
  • Dockerfile Generator
  • Sitemap Generator

API & networking

  • REST Handler
  • HTTP Header Analyzer
  • IP Address Lookup
  • CIDR Calculator
  • User-Agent Parser
  • HTTP Status Reference
  • OpenAPI Viewer

Date & time

  • Timestamp Converter
  • Timezone Converter
  • Cron Expression Parser
  • Duration Calculator
  • Age Calculator
  • Date Format Converter

Images

  • Image Converter
  • Image Resizer (Batch)
  • SVG Optimizer
  • Base64 ↔ Image
  • WebP ↔ AVIF Converter
  • Image Compressor

PDF tools

  • PDF Merger
  • PDF Splitter
  • PDF Compressor
  • Markdown → PDF
  • EPUB → PDF
  • MOBI / AZW → PDF
  • DOCX → PDF
  • HTML → PDF

Resources

  • Community feed
  • Themes marketplace
  • Pricing & credits
  • Privacy policy
  • Terms of service
  • Sitemap
  • robots.txt

Your account

  • Sign in
  • Dashboard
  • Run history
  • My profile
  • Settings
DevTools Surf logo
DevTools Surf919+ tools

Fast · privacy-first · client-side · © 2026

Home·Feed·ThemesPricing·Sign inPrivacy·Sitemap Feedback