JSON/XML to Readable Text
Paste JSON, JSON Lines or XML and get plain, readable text (flattened paths, an outline or Markdown tables) for people, docs and AI prompts. Nothing is uploaded.
JSON or XML
0 charactersJSON, JSON with comments, JSON Lines (one record per line) and XML are detected automatically. Nothing is uploaded.
Options
Readable text
- ChatGPT tokens
- ≈ 0
- Claude tokens
- ≈ 0
- Gemini tokens
- ≈ 0
Token counts are estimates, not exact. How they're estimated
Split into parts for a chat
For long documents: each part fits one message and keeps headings, tables and code blocks whole. A table that has to be split repeats its header row in every part.
Why turn JSON or XML into readable text?
Deeply nested data is hard to read, and pretty-printed JSON spends much of its length on braces, quotes, indentation and repeated key names. Flattening gives every value its own line with its full path, like user.address.city, so nothing is buried five levels down and every value is easy to refer to. Markdown turns lists of records into tables that name each field once, usually the most compact form for an AI prompt.
How to convert JSON to text
- Paste JSON, JSON Lines or XML, or open a .json, .jsonl or .xml file. The format is detected for you.
- Pick Flattened, Indented or Markdown.
- For big responses, use Show at most and Skip empty values to keep only what matters.
- Copy the text or download it; compare the input and output token estimates under the result.
Three ways to read the same data
| Mode | What you get | Best for |
|---|---|---|
| Flattened | One path: value line per value | Scanning, searching, diffing two versions, precise questions about fields |
| Indented | A nested outline without brackets or quotes | Reading the shape of a document, config files |
| Markdown | Bullet lists, ## sections, tables for lists of records | AI prompts, documentation, sharing with non-developers |
Example
This order record:
{
"order": 1042,
"customer": { "name": "Ana Silva", "city": "Lisbon" },
"items": [
{ "sku": "NB-A5", "qty": 2, "price": 4.50 },
{ "sku": "PEN-B", "qty": 10, "price": 1.20 }
],
"config": { "log.level": "debug" }
}flattens to one line per value, with array positions in brackets and the dotted key log.level quoted so it can't be mistaken for nesting:
order: 1042
customer.name: Ana Silva
customer.city: Lisbon
items[0].sku: NB-A5
items[0].qty: 2
items[0].price: 4.50
items[1].sku: PEN-B
items[1].qty: 10
items[1].price: 1.20
config["log.level"]: debugIn Markdown mode the same data becomes sections and a table, with the item fields named once instead of on every item:
- **order**: 1042
## customer
- **name**: Ana Silva
- **city**: Lisbon
## items
| sku | qty | price |
| --- | --- | --- |
| NB-A5 | 2 | 4.50 |
| PEN-B | 10 | 1.20 |Numbers are copied exactly as written: 4.50 stays 4.50 and long IDs aren't rounded, as they would be by a plain JavaScript JSON.parse.
XML, feeds and JSON Lines
- XML elements become keys, attributes
@nameand text inside an element with attributes#text. Repeated elements, like the<item>s of an RSS feed, become a list, so a feed comes out as a table in Markdown mode. - Namespaces:
xmlnsdeclarations are hidden by default; prefixes such asdc:creatorare kept because they're part of the name. - JSON Lines (also called NDJSON), with one JSON object per line as in log files, analytics exports and AI batch files, is read as a list of records.
Getting API responses into an AI chat
- Trim first. Show at most 3 per list keeps the structure of a 5,000-item response while cutting it to a few hundred tokens: enough for a model to write code against it or explain the fields.
- Check the token estimates. The result card shows the input's tokens next to the output's, so you can see which mode is most compact for your data. Markdown tables usually win for lists of records: with 50 customer records they used about half the tokens of pretty-printed JSON and a quarter fewer than minified JSON in our test. For deep, irregular objects minified JSON is already compact, and flattening is about readability rather than size.
- Split big data. Split into parts divides long output at line and section boundaries, and repeats a table's header in every part.
- Mind secrets. Nothing leaves your browser here, but the chat you paste into is another matter: remove tokens, keys and personal data first.
Need JSON as a spreadsheet instead? The JSON to CSV converter turns records into columns. To validate, repair or pretty-print JSON itself, use the JSON Formatter; for YAML, the YAML Validator. Pages and documents have their own converters: HTML to Markdown and DOCX to Markdown.
How the token estimates work
The input figure counts your JSON or XML exactly as pasted, so the comparison shows what the conversion saves.Chat models read text as tokens: whole words, pieces of longer words, numbers and punctuation. Each model family splits text its own way, so one document has a different count in ChatGPT, Claude and Gemini. The counts here are worked out in your browser, without sending the text anywhere:
- ChatGPT: the text is cut up with the same splitting rules as OpenAI's o200k tokenizer (used by GPT-4o and later models), and each piece is costed from statistics measured on that tokenizer. In our tests it came within about 5% of the real count for English prose, Markdown and code; for JSON, HTML and some languages it can be 10–30% off.
- Gemini: calibrated the same way against the tokenizer Google released with its open Gemma 3 models, which Google's Gemma 3 report describes as the one Gemini 2.0 uses. It splits every digit into its own token, so tables and numbers cost noticeably more than the usual "about 4 characters per token" rule of thumb suggests. In our tests it was within about 10% for English text, code and data.
- Claude: Anthropic doesn't publish its tokenizer, so this is the roughest of the three. Claude typically counts 15–20% more tokens than OpenAI's tokenizer for English and more for code, numbers and non-Latin scripts; the estimate applies those ratios to the ChatGPT figure. The newest Claude models can count somewhat more again.
Treat them as planning numbers: good for "will this fit?" and for splitting, not for billing. When you split a document into parts, choose a part size with some headroom below your model's limit, and remember that your own question and the AI's answer use tokens too.
Frequently Asked Questions
How do I convert JSON to readable text?
Paste the JSON (or open a .json file) and the readable version appears as you type. Choose Flattened for one "path: value" line per value, Indented for a nested outline, or Markdown for bullet points and tables. Copy the result or download it.
Does it auto-detect JSON, JSON Lines and XML?
Yes. Input that starts with < is read as XML; anything else as JSON. Several JSON values one per line (JSON Lines or NDJSON, common in logs and exports) are read as a list of records, and JSON with comments or trailing commas (JSONC, as in config files) is accepted too.
What does "flattened" mean?
Every value gets its own line with its full path, like user.address.city: Boston or items[2].price: 9.99, instead of being buried several levels deep. Keys that would make a path ambiguous, such as one containing a dot, are written in brackets and quotes: config["log.level"]: debug.
What's the difference between Flattened, Indented and Markdown?
Flattened gives one dotted path per line: best for scanning, searching and diffing. Indented shows the same data as a nested outline without brackets. Markdown turns objects into bullet lists and lists of records into tables, which reads well in documents and is compact for AI prompts.
Is flattened text or Markdown better than raw JSON for ChatGPT or Claude?
It depends on the shape. For a list of records, Markdown tables are usually the most compact, because each field name appears once instead of on every record. For a deeply nested object, minified JSON is already compact; flattened paths cost a few more tokens but make every value unambiguous and easy to refer to. The result card estimates the tokens of your input and of the output, so you can compare for your own data.
How are XML attributes and text handled?
Attributes appear as @name (item.@id: 42), and an element's own text as #text when it also has attributes or child elements. Namespace declarations (xmlns) are hidden by default because they rarely mean anything to a reader; untick the option to keep them. Repeated elements become a list.
Can I shorten a huge API response?
Yes. "Show at most" keeps only the first few items of every list and notes how many were left out, which is often all an AI model needs to understand a response's structure. "Skip empty values" removes null, empty strings, [] and {}.
Are numbers and key order kept exactly?
Yes. Numbers are shown exactly as written, so a 19-digit ID like 12345678901234567890 isn't rounded and 1.10 doesn't become 1.1, which a standard JSON parser would do. Keys stay in the order they appear, including numeric-looking keys such as "2024" that JavaScript would otherwise move to the front.
What happens if my JSON or XML is invalid?
You get an error naming the line and column where reading stopped and what was found there, such as a missing comma or closing bracket. Comments and trailing commas, as in tsconfig.json or VS Code settings, are accepted. Single quotes and unquoted keys are not; the JSON Formatter can repair those common mistakes.
Is this the same as formatting or prettifying JSON?
No. A formatter re-indents JSON but keeps it as JSON for programs. This tool turns it into text for people and language models. To pretty-print or validate JSON itself, use a JSON formatter.
Is my data uploaded anywhere?
No. Parsing and conversion happen in your browser tab; nothing is sent to a server, so API responses with tokens or personal data stay on your device. Only your option choices are remembered in this browser.
Related tools
More free, private, browser-based utilities — no upload, no sign-up.