Turn a document into a single-line ASCII payload you paste into headers, JSON properties, or tickets. Validate and tidy first, then encode or reverse the process without sending files to a server.
Syntax highlighting only helps reading; encoding uses the raw UTF-8 bytes of your text.
Straight talk
Binary-safe channels are everywhere now, yet teams still embed XML inside JSON, email bodies, or query strings where only printable characters survive. Base64 is the dull hammer for that job: larger on the wire, predictable, supported in every language.
This encoder exists for the moment you already have XML text and need the Base64 string beside it.
You supply UTF-8 text in the editor. The page optionally checks well-formedness with the browser parser, optionally pretty-prints via the same DOM, then reads the string as UTF-8, encodes bytes with Base64, and writes the result to the dark panel below. Decoding reverses the path.
Nothing uploads. Clipboard access stays on your device. If you need schema validation against an XSD, use a dedicated validator first; this tool only understands structural XML rules.
Base64 is not encryption. Anyone with the string reverses it instantly. Do not treat encoded health records, tokens, or secrets as protected. Pair real cryptography with your transport and storage policies.
| Approach | Readable in plain text? | Typical use |
|---|---|---|
| Base64 | No | Embedding opaque blobs in JSON, XML attributes, or logs |
| Percent / URL encoding | Partly | Query strings; see our URL encoding helper for a different escape model |
| XML entity escaping | Yes | Keeping markup inside text nodes; pair with escape / unescape when angle brackets must stay literal |
encoding="UTF-8" in the header.Terminal one-liners and CI scripts often beat copy-paste for repeatable jobs. This UI still helps when you lack shell access, when you want visual validation, or when you only need a single string for a ticket comment.
Scripts run after download; we do not see your XML or Base64 unless your browser or extensions intercept clipboard events.
Below is a trimmed invoice-style fragment. Your own files look messier; the mechanics stay identical. Encode here, drop the string into a JSON property, and the receiver decodes back to the same bytes assuming UTF-8 end to end.
<?xml version="1.0" encoding="UTF-8"?><invoice id="INV-7781"><total currency="USD">142.50</total></invoice>
PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPGludm9pY2UgaWQ9Ikludi03NzgxIj4KICA8dG90YWwgY3VycmVuY3k9IlVTRCI+MTQyLjUwPC90b3RhbD4KPC9pbnZvaWNlPg==
Line endings matter. Windows CRLF and Unix LF produce different Base64 strings. If a signature or HMAC fails across systems, normalize newlines before encoding rather than blaming the algorithm.
Browser btoa paths only behave when the string fits in memory. Multi-megabyte XML belongs in streaming tools. For occasional large pastes, watch for tab freezes rather than silent corruption.