JSON/XML to Readable Text
Paste JSON or XML, get a flattened, de-nested plain-text version — ready to scan or paste into an AI tool.
Input (JSON or XML)
0 charsWhy flatten JSON or XML?
Deeply nested data is hard to scan and expensive to paste into an AI prompt — a large share of the tokens go on braces, brackets and quotes rather than content. Flattening gives every value its own line with a full path like user.address.city, so nothing is ambiguous and nothing is buried five levels down.
How it works
- Paste JSON or XML — the format is detected automatically.
- Choose Flattened for one path per line, or Indented for a nested tree.
- XML attributes appear as @name, element text as #text.
- Copy the readable output.
Frequently Asked Questions
Does it auto-detect JSON vs. XML?
Yes — just paste either one in and it figures out which it is. No need to tell it in advance.
What does "flattened" mean here?
Every nested value gets its own line as a full path, like user.address.city: Boston, instead of staying buried several levels deep. It's the fastest way to scan a deeply nested structure or paste it into an AI prompt without ambiguity.
What's the difference between Flattened and Indented view?
Flattened shows one dotted path per line — good for scanning or search. Indented shows the same data as a nested tree, closer to how the original JSON/XML looked — good for preserving visual structure.
How are XML attributes handled?
Attributes appear as @attributeName in the path, and an element's own text content (when it also has child elements) appears as #text.
Why feed flattened text to an AI instead of raw JSON?
Raw JSON spends a large share of its tokens on braces, brackets and quotes. Flattening strips that scaffolding while keeping the full path to every value, so the model gets the same information in fewer tokens and with less chance of misreading the nesting.
How are arrays represented?
Array positions appear as numeric indices in the path, like items.0.name, so you can always tell which element a value came from.
What happens if my JSON or XML is invalid?
You'll get a parse error rather than partial output. Run it through the JSON formatter first, which pinpoints where the syntax breaks.
Is this the same as formatting or prettifying JSON?
No. Formatting re-indents JSON but keeps it as JSON. This converts it into flat readable lines meant for people and language models rather than parsers.
Is there a size limit?
No fixed limit. Parsing runs in your browser's memory, so very large documents are bounded by your device rather than an upload cap.
Is my data uploaded anywhere?
No. Parsing and flattening both happen entirely in your browser using JavaScript. Nothing is sent to a server.
Related tools
More free, private, browser-based utilities — no upload, no sign-up.

Davemi