JSON Multiline String
FV-25JSON strings cannot hold real line breaks, so they appear as \n. This tool shows them on separate lines for reading, or splits long strings into shorter pieces.
Runs in your browser. Nothing is uploaded.
JSON
Result
How to use it
- Paste your JSON into the input box.
- Click Show on multiple lines to see each \n as a real line break inside the string.
- Or choose a piece length and click Split long values to cut long strings into an array of pieces.
- Copy the result.
Show on multiple lines
The JSON is printed with two space indentation, and every \n inside a string value becomes a new line, so a long note or log message is readable. Other escapes such as \t and \" stay escaped. The result is not valid JSON, because a JSON string must stay on one line. Use it to read or review data, and keep the original text for parsing. Keys are left as they are.
Split long values
Each string longer than the chosen length is replaced by an array of strings, each at most that many characters, cut by character rather than at word boundaries. The output is valid JSON, but the structure changed: wherever a string was, there is now an array, and your code has to join the pieces. Shorter strings, numbers and keys are untouched, and big integers keep every digit.
Error messages and what to do
| Message | What it means | Fix |
|---|---|---|
Unexpected end of input | The JSON is cut off before it is complete. | Close every open bracket, brace and quote. |
Expected a string key | An object key is not in double quotes. | Write keys with double quotes. |
Questions people ask
Can a JSON string contain a real line break?
No. The JSON standard does not allow raw control characters, including line breaks, inside a string. A line break must be written as \n. Some tools accept raw breaks, but a strict parser rejects them.
How do I make a long JSON string multiline?
JSON has no multiline string syntax. You can store the string as an array of shorter strings and join them in code, which is what Split long values produces, or put real \n breaks in the text and display them as lines.
Is the Show on multiple lines output valid JSON?
No, it is meant for reading. Real line breaks inside quotes make it invalid for parsers. Keep your original JSON for any program, and use this view for review or documentation.
Where does Split long values cut the text?
Exactly at the number of characters you choose, counting each Unicode character once, so an emoji is not cut in half. It does not look for spaces, so words can be split across pieces.
Are my numbers changed?
No. Numbers, booleans and null are copied exactly as written, including large integers beyond 15 digits. Only string values are touched, and only when they contain a line break or are longer than the chosen length.
About this tool
Show on multiple lines prints the JSON with two space indentation and puts each line break (\n) inside a string on a real new line. The result is easy to read but is not valid JSON, because JSON strings cannot span lines, so use it for reading, not for parsing. Split long values replaces each string longer than the chosen length with an array of pieces of that many characters, which changes the structure: the output is valid JSON, but your code must join the pieces again. Numbers are kept exactly as written. Strings are split by character, not at word boundaries.