Text to JSON Lines
Paste multi-line text to convert each line into a JSON string (wrapped in quotes) or a JSON object with a configurable key name. Optionally skip blank lines. Download or copy the resulting JSONL file, one valid JSON value per line. Runs entirely in your browser.
Convert ordinary text into JSON Lines by encoding each input line as a JSON string or wrapping it in a one-property JSON object. Empty-line handling and the object key are configurable.
How to convert text to JSONL
- Paste or type multi-line text.
- Choose whether empty lines should be skipped.
- Optionally enable object wrapping and enter the property name.
- Run the conversion or wait for the automatic update.
- Copy the generated JSONL.
How each line is encoded
The input is split on newline characters and a trailing carriage return is removed from each line. With object wrapping off, each line becomes JSON.stringify(line). With wrapping on, each line becomes an object such as {"line":"text"}, using the chosen key.
Skip empty lines checks line length after removing a trailing carriage return but does not trim spaces. A line containing only spaces is therefore not considered empty. If the object-key field is blank after trimming, the key defaults to line.
Privacy and limitations
Conversion happens locally in the browser and input text is not intentionally uploaded. The tool treats each physical line independently and does not parse CSV, infer data types, combine paragraphs, or interpret an input line as existing JSON.
Frequently asked questions
Are quotes and backslashes escaped safely?
Yes. JSON.stringify creates valid JSON string escaping for each line.
Can I wrap every line in an object?
Yes. Enable object wrapping and choose the property name.
What happens if the object key is blank?
It falls back to the key line.
Are whitespace-only lines skipped?
No. Skip empty lines only removes lines whose length is zero; spaces are preserved as content.
Does the tool parse JSON already present in a line?
No. Each input line is treated as plain text and encoded as a JSON string or object value.