JSONify String
FV-29Paste text and click JSONify string to get a valid JSON string. You can also wrap it in an object, turn lines into an array, or turn key=value lines into an object.
Runs in your browser. Nothing is uploaded.
Text, one value per line, or key=value lines
JSON
How to use it
- Paste your text into the input box.
- Click JSONify string for a quoted string. Click Wrap in object to put it under a key, or Lines to array to make one item per line.
- For settings such as name=Ada, paste one pair per line, pick the separator and click Pairs to object.
- Copy the JSON or download it as a .json file.
Four ways to make JSON from text
JSONify string wraps the whole input in double quotes and escapes what JSON requires, so line breaks become \n. Wrap in object puts that string under a key you choose. Lines to array turns each line into a string in an array, with options to skip empty lines and trim spaces. Pairs to object splits each line at its first separator into a key and a value.
What it does not do
Values are always text. A line such as age=42 gives "42", not the number 42, because the tool does not guess types. If a key repeats, the last value wins and the key stays at the position of its first appearance. A line with no separator is an error with its line number. The tool does not read JavaScript object syntax. Use String to JSON for that.
Error messages and what to do
| Message | What it means | Fix |
|---|---|---|
to split the key from the value. | A line in Pairs to object has no separator. | Add the separator you selected, or change the separator option. |
No lines to convert. | Lines to array found nothing after skipping empty lines. | Paste at least one non-empty line. |
Questions people ask
What does it mean to JSONify a string?
It means writing text so it is valid in JSON: wrapped in double quotes, with quotes, backslashes and line breaks escaped. The result can be used as a JSON value, or placed inside an object or array.
How do I turn lines of text into a JSON array?
Paste one value per line and click Lines to array. Each line becomes a quoted string. By default empty lines are skipped, and you can tick Trim each line to remove spaces at both ends before the lines are quoted.
Can I convert key=value pairs to a JSON object?
Yes. Paste lines like name=Ada, choose =, : or tab as the separator, and click Pairs to object. Each line is split at its first separator, so a value may itself contain more of the same character, such as a URL with a query string.
Will numbers and booleans be detected?
No. Every value is written as a string, so true stays "true" and 42 stays "42". Detecting types would mean guessing, which can damage data such as ZIP codes with leading zeros. Edit the output if you need real numbers.
How are special characters handled?
Quotes, backslashes and control characters are escaped, so the output always parses as JSON. Accented letters and emoji are left as they are unless you tick the option to write non-ASCII as \uXXXX escapes.
About this tool
JSONify string wraps your whole text in double quotes and escapes what JSON needs, so line breaks become \n. Wrap in object puts that string under a key you choose. Lines to array makes each line one string in an array. Pairs to object splits every line at its first separator into a key and a text value. Values stay text, so 42 becomes "42", not a number, and if a key repeats, the last value wins at the position of the first. A line with no separator is an error with its line number. It does not guess types and does not parse JavaScript object syntax. Nothing is uploaded.