Build data URL

Build a data URL from a media type and inline text or Base64 bytes.

freeworks offlinenothing uploaded
ToolData URL Builder
Input
Output
Put this on your own site

The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.

Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.

Preview

How it works

Media type, parameters, and percent-encoded text or Base64 payload are joined after data:. The comma separates metadata from data, and Base64 mode encodes bytes rather than characters.

  • Base64 suits binary payloads.
  • Percent-encoding is shorter for small ASCII text.

Worked example

Plain Text Data URL
Create a data URL from a simple text string
Input
											Hello, World!
										
Output
												data:text/plain;charset=utf-8;base64,SGVsbG8sIFdvcmxkIQ==
											

When to use this

Inline images, SVG previews, and tiny test fixtures build data URLs.

Edge cases

  • A comma in metadata must be encoded.
  • Standard data URLs are not automatically Base64url.
  • Large data URLs can exceed browser or proxy limits.

References