Already escaped
Double-stringifying over-escapes quotes.
Fix: Decode with JSON Unstringify first.
header • up to 320x100 / 728x90
Wrap an XML document in a JSON string literal for safe embedding in payloads
Output will appear here...
content bottom • up to 300x250
sidebar • 160x600
Last reviewed:
XML (Extensible Markup Language) is a strict, tag-based format used for documents, SOAP APIs, RSS feeds, and many enterprise and publishing systems.
XML Stringify passes your XML document through JSON.stringify, producing a JSON-safe string literal with all required escapes applied.
It's a quick way to embed SOAP envelopes, SVG snippets, or Android XML fragments inside a JSON field without manually escaping anything.
<note id="1">Hello</note>
"<note id=\"1\">Hello</note>"
Double-stringifying over-escapes quotes.
Fix: Decode with JSON Unstringify first.
JSON can't hold raw binary.
Fix: Base64-encode any binary payloads inside the XML.
No — it treats input as a raw string. Run XML Parser beforehand if validation is required.
Use JSON Unstringify.
No — whitespace is preserved and escaped as-is.
No — processing is client-side.
Yes — CDATA blocks are escaped as regular string content.
Pair XML Stringify with parser, validator, and JSON unstringify helpers. You can also browse the full Encoders & Decoders category for more options.
Unwrap a JSON string literal back to raw text — reverses JSON.stringify
Parse and pretty-print XML documents with automatic validation and indentation
Validate XML syntax and catch well-formedness errors quickly. Paste XML and get instant feedback on missing tags, unclosed elements, and malformed attributes.
Wrap a raw string in a JSON string literal — perfect for embedding content in a JSON payload
Escape or unescape XML special characters and numeric entities with one click
Percent-encode or decode an XML payload for safe transmission in query strings and URLs
Encode XML for URL parameters
Escape or unescape C# string literals including \x, \u, and \U Unicode escape sequences
Round-trip Java string literals — escape quotes, backslashes, newlines, and Unicode sequences
Escape or unescape JavaScript string literals with backslash, quote, Unicode, and control-character handling
Escape or unescape SQL string literals using standard single-quote doubling
Encode or decode HTML entities