Convert XML to a Data URI instantly. Choose between Base64 or URI encoding, wrap lines for readability, and export with live preview no uploads required.
How to Use:
- Paste your XML into the input box or click Choose File to import
.xml
,.txt
, or.html
- Select the Encoding Mode:
- Base64: encodes the XML into a
data:application/xml;base64,...
URI - URI encode: uses percent-encoding in the form
data:application/xml,...
- Base64: encodes the XML into a
- Toggle Wrap output to insert line breaks in the output
- Adjust the Wrap width (default is 76 characters) to control line length
- Turn on Maximize output to expand the output area
- Output updates instantly as you edit or toggle settings
- Click Copy Output to copy the Data URI
- Click Export to File to download the result as a
.txt
file - Use Clear All to reset the tool
What Convert XML to a Data URI can do:
Convert XML to a Data URI gives you an easy way to embed XML directly into web pages, scripts, or apps. It supports both Base64 and URI-style encoding, so you can choose the format best suited to your use case. Want to embed a small XML payload in an iframe or link tag? Just paste it in, choose your encoding, and copy the result. It’s perfect for developers who need fast, portable, and client-side-safe XML embedding no servers, no extra tools.
Example:
Input XML:
<note><to>Tove</to><from>Jani</from></note>
Data URI (Base64):
data:application/xml;base64,PG5vdGU+PHRvPlRvdmU8L3RvPjxmcm9tPkphbmk8L2Zyb20+PC9ub3RlPg==
Data URI (URI encoded):
data:application/xml,%3Cnote%3E%3Cto%3ETove%3C%2Fto%3E%3Cfrom%3EJani%3C%2Ffrom%3E%3C%2Fnote%3E
Common Use Cases:
Convert XML to a Data URI is ideal for embedding raw XML into HTML, CSS, or JavaScript. It’s commonly used in prototyping, static testing, or passing XML into tools or frameworks that expect inlined content. Whether you’re building a data URL for a web component or storing XML in a QR code or config file, this tool handles the encoding cleanly and instantly.
Useful Tools & Suggestions:
If you’re packaging XML for embedding, try Convert XML to Base64 first it’s a clean step before wrapping it in a Data URI. And once it’s ready, Validate XML ensures the payload still holds up.