π€ JSON to Text Converter Online
By Shihab Mia Β· Updated 2026-07-01
This tool turns pasted JSON into readable text three ways. Beautify re-formats it with clean indentation, Minify strips every space onto one line, and Flatten to text lists each value as a plain "dot.path.key: value" line. Paste your JSON, pick a mode, and copy the result. If the JSON is broken, you get the exact parser error in red so you can fix it fast. Everything runs in your browser, so the JSON never leaves the page.
What is the JSON to Text Converter?
JSON (JavaScript Object Notation) is a text format for structured data, but the same data can be written in very different shapes. A minified API response is one dense line with no spaces, which is efficient for machines but painful to read. A beautified version adds line breaks and indentation so a human can follow the nesting. This converter moves your JSON between those shapes and, when you need something even plainer, collapses it into a flat list of key paths and values. All three are lossless in the sense that Beautify and Minify preserve the exact data, they only change the whitespace.
Beautify works by parsing the text into a real object and then re-serialising it with a chosen indent. Because it parses first, it also acts as a validator: if the input is not valid JSON, it cannot be beautified and you see the parser message instead. The indent choice (2 spaces, 4 spaces, or a tab) is purely cosmetic. Two spaces is the most common default in config files and JavaScript projects, four spaces suits people who like more separation, and tabs let each viewer set their own width. The data itself is identical whichever you pick.
Minify does the opposite. It parses the JSON and re-serialises it with no spaces or line breaks at all, producing the most compact valid form. This is what you want before embedding JSON in a URL, a data attribute, or a request body, or when you are measuring or reducing payload size. Minifying also normalises the formatting, so two files that differ only in whitespace become byte-for-byte identical, which is handy for comparing or hashing.
Flatten to text is the plain-text mode. Instead of keeping the nested braces, it walks the whole structure and writes one line per leaf value, naming each value by the path used to reach it: object keys are joined with dots and array items are shown with their index in square brackets. So {"address":{"city":"London"}} becomes address.city: London. This is ideal for grep-style searching, for pasting values into a spreadsheet or a document, or for quickly reading a big config without mentally parsing the brackets. Empty objects and arrays are shown as {} and [] so nothing silently disappears.
When to use it
- Beautifying a minified API response so you can actually read the fields and nesting while debugging.
- Minifying a JSON config before pasting it into a URL, a data-* attribute, or a request body where size matters.
- Flattening a deep config file into a simple list of dot.path: value lines you can scan or grep.
- Turning JSON into plain text you can drop into a document, an email, or a spreadsheet without the braces.
- Validating JSON on the fly, the red error message pinpoints where the parser gave up.
- Normalising two JSON snippets to the same formatting so a diff only shows real data changes.
How to use the JSON to Text Converter
- Paste or type your JSON into the input box at the top.
- Choose a mode: Beautify, Minify, or Flatten to text.
- For Beautify, pick an indent of 2 spaces, 4 spaces, or a tab.
- Read the converted text in the result box, it updates as you type.
- Click Copy to put the result on your clipboard, or Load sample to see an example.
Formula & method
Worked examples
Beautify a minified object with a 2 space indent. Input: {"name":"Ada","born":1815}
- The tool runs JSON.parse on the input, turning the text into a real object.
- Because parsing succeeds, the JSON is valid, no error is shown.
- It re-serialises with JSON.stringify(value, null, 2), adding line breaks and 2 space indentation.
- Each key goes on its own indented line inside the braces.
Result: A multi line block: {\n "name": "Ada",\n "born": 1815\n}
Flatten a nested object to text. Input: {"address":{"city":"London","zip":"SW1"},"active":true}
- The tool parses the input, then walks the structure leaf by leaf.
- For address.city it joins the two keys with a dot and outputs the value: address.city: London
- For address.zip it does the same: address.zip: SW1
- active is a top level boolean, so it outputs active: true
Result: Three lines: address.city: London / address.zip: SW1 / active: true
What each mode does to the same JSON
| Mode | What it changes | Best for |
|---|---|---|
| Beautify | Adds line breaks and indentation, data unchanged | Reading and debugging responses |
| Minify | Removes all whitespace onto one line | Smaller payloads, URLs, data attributes |
| Flatten to text | Replaces nesting with dot.path: value lines | Grep, spreadsheets, plain documents |
How values look after flattening
| JSON input | Flattened text output |
|---|---|
| {"a":1} | a: 1 |
| {"user":{"id":7}} | user.id: 7 |
| {"tags":["x","y"]} | tags[0]: x and tags[1]: y |
| {"note":null} | note: null |
| {"list":[]} | list: [] |
Common mistakes to avoid
- Pasting JavaScript objects instead of JSON. JSON requires double quotes around every key and string, no trailing commas, and no comments. Object notation copied from JavaScript code (single quotes, unquoted keys, // comments) will fail to parse. Convert it to strict JSON first.
- Expecting Beautify to fix invalid JSON. Beautify parses the input before re-formatting, so it can only pretty print JSON that is already valid. If you see a red error, the input has a syntax problem such as a missing brace or an extra comma that must be fixed before formatting.
- Assuming minify changes the data. Minify only removes whitespace. The keys, values, and structure are identical, so the minified and beautified versions represent exactly the same data. Do not expect numbers to be rounded or keys to be dropped.
- Thinking flatten output is still JSON. Flatten to text produces plain text lines, not JSON. You cannot parse the result back into an object with a JSON parser. Use Beautify or Minify when you need output that is still valid JSON.
Glossary
- JSON
- JavaScript Object Notation, a text format for representing structured data as objects, arrays, strings, numbers, booleans, and null.
- Beautify
- Reformatting JSON with line breaks and indentation so it is easy for a person to read. Also called pretty printing.
- Minify
- Reformatting JSON with no spaces or line breaks so it takes the fewest characters, useful for transport and storage.
- Flatten
- Collapsing a nested structure into a single level, here into one dot.path: value line per leaf value.
- Leaf value
- A value that is not itself an object or array, such as a string, number, boolean, or null. Flatten outputs one line per leaf.
- Indent
- The whitespace (2 spaces, 4 spaces, or a tab) placed before nested lines to show the depth of the structure.
Frequently asked questions
How do I convert JSON to text?
Paste your JSON into the input box and choose a mode. Beautify gives readable indented text, Minify gives one compact line, and Flatten to text gives plain dot.path: value lines. The result appears instantly and you can copy it with one click.
What is the difference between beautify and minify?
Both keep the data identical and only change whitespace. Beautify adds line breaks and indentation so people can read the structure, while Minify removes all spaces and line breaks to make the smallest possible one line version.
What does flatten to text do?
It walks the whole JSON structure and writes one line for every leaf value, naming each value by its path. Object keys are joined with dots and array items use their index, so {"a":{"b":1}} becomes a.b: 1. The output is plain text, not JSON.
Why do I get an invalid JSON error?
The tool tries to parse your input first, and shows the exact parser message if it fails. Common causes are single quotes instead of double quotes, unquoted keys, trailing commas, or a missing bracket. Fix the spot the message points to and convert again.
Is my JSON uploaded or stored anywhere?
No. All parsing and conversion happen in your browser with JavaScript, so your JSON never leaves the page and nothing is sent to a server. That makes it safe for private API keys, tokens, or config data.
Which indent should I choose when beautifying?
Two spaces is the most common default in JavaScript and config files, four spaces gives more visual separation, and a tab lets each viewer set their own width. The choice is cosmetic and does not change the data at all.
Sources
- JSON.stringify() , MDN Web Docs
- JSON.parse() , MDN Web Docs