XML to Base64
Encode an XML document as Base64: UTF-8 bytes first, so an accented attribute value round-trips.
What encoding XML as Base64 does
The document is turned into UTF-8 bytes and then into the standard Base64 alphabet with padding. Encoding as UTF-8 first is what makes a non-ASCII attribute value survive: encoding the JavaScript string directly would produce the wrong bytes for anything outside Latin-1. The output has no line breaks, so it fits a single SOAP attachment header, an environment variable or a database column.
How to use it
XML to Base64: paste the XML into the box above, and press Run to get the Base64 below.
Worked example
Input:
<note to="Ada">café & crème</note>
Output:
PG5vdGUgdG89IkFkYSI+Y2Fmw6kgJmFtcDsgY3LDqG1lPC9ub3RlPg==
Why it runs in your browser
The conversion happens on this page with JavaScript. Your input is not posted to a server, so it works offline after the page loads and nothing is retained anywhere. The page reads XML and returns Base64; reloading the page discards both.
The document is turned into UTF-8 bytes and then into the standard Base64 alphabet with padding. Encoding as UTF-8 first is what makes a non-ASCII attribute value survive: encoding the JavaScript string directly would produce the wrong bytes for anything outside Latin-1. The output has no line breaks, so it fits a single SOAP attachment header, an environment variable or a database column.
Encode an XML document as Base64: UTF-8 bytes first, so an accented attribute value round-trips.
How to use it
XML to Base64: paste the XML into the box above, and press Run to get the Base64 below.
Why it runs in your browser
The conversion happens on this page with JavaScript. Your input is not posted to a server, so it works offline after the page loads and nothing is retained anywhere. The page reads XML and returns Base64; reloading the page discards both.
What to Expect
Best for
- Converting XML to Base64 when the data is already on screen.
What this tool keeps
- Your input is not posted to a server, so it works offline after the page loads and nothing is retained anywhere.
Sample input
<note to="Ada">café & crème</note>
Sample output
PG5vdGUgdG89IkFkYSI+Y2Fmw6kgJmFtcDsgY3LDqG1lPC9ub3RlPg==
Frequently asked questions
How do I use the xml to base64?
XML to Base64: paste the XML into the box above, and press Run to get the Base64 below.
Is my input uploaded?
No. The text is parsed on this page with JavaScript and is never posted to a server.
Is there a size limit?
Yes: 5 MB per run. Larger input is refused with a message rather than freezing the tab.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.