JSONify String
Convert plain text into a valid JSON string.
JSONify String – Convert Text to a JSON String
JSONify String converts any plain text into a valid JSON string literal. Quotes, backslashes, tabs, and line breaks are escaped exactly as the JSON standard requires, so you can paste the result into a JSON file, an API request body, or a configuration value without a single syntax error.
Why not just add quotes?
Wrapping text in quotes works only until the text contains a quote, a backslash, or a line break — then the JSON breaks. Multi-line messages, Windows file paths, HTML templates, SQL queries, and regular expressions all need careful escaping. This tool does it for you, character by character, following RFC 8259.
Two output styles
- One JSON string – the whole text becomes a single value, with line breaks as
\n. Ideal for message bodies, templates, and descriptions. - Array of lines – every line becomes its own string in a JSON array. Great for turning a pasted list into JSON data. Empty lines can be skipped.
Turn on Escape non-ASCII to convert every character outside ASCII into a \uXXXX sequence. The JSON stays valid either way, but pure-ASCII output is safer for old systems, some HTTP headers, and files with unknown encoding.
Examples
He said "hi"→"He said "hi""C:\temp→"C:\temp"- Two lines →
"line one\nline two"
Related tools
Convert whole JSON documents to strings with JSON Stringify, escape or unescape text without quotes in JSON Escape, or keep multi-line text readable with JSON Multiline String.
Frequently Asked Questions
What does 'JSONify' mean?
It means turning plain text into a valid JSON value. For a string that's a quoted literal with every special character escaped, so the text can be dropped into any JSON document without breaking it.
Which characters are escaped?
Double quotes, backslashes, and control characters: line breaks become \n, carriage returns \r, tabs \t, and other control codes \u00XX. With “Escape non-ASCII” on, characters such as é, ç, or emoji become \uXXXX sequences too, which keeps the output pure ASCII.
When should I use 'Array of lines'?
When each line is a separate item — a list of names, URLs, or keywords. You get a JSON array like ["first", "second"] instead of one string with \n separators.
How is this different from JSON Stringify?
JSON Stringify expects JSON as input and turns it into a string. JSONify String accepts any plain text — a message, an HTML snippet, a SQL query — and makes it a JSON string.