Text to JSON converter

Convert plain key:value text into structured JSON objects. Each line should be in key: value or key = value format. Runs entirely in your browser.

Text input

JSON output

What this converter does

Text to JSON turns plain key: value lines into a JSON object. It is useful when notes, settings or sample data are written as simple text and you need JSON for an API request, a config file or a test fixture. The conversion runs in your browser.

How to use it

  1. Type or paste one key: value pair per line into the input box. For example, name: John on one line and age: 30 on the next.
  2. Click Convert to JSON. The result appears in the output box.
  3. Copy the output or download it.

Example input and output:

name: John age: 30
{ "name": "John", "age": 30 }

How the conversion works

Each line is split at its first : (or at = if the line has no colon). The text before the separator becomes the key, and the text after it becomes the value, with surrounding spaces removed.

  • true and false become JSON booleans.
  • Values that look like numbers become JSON numbers, so 30 stays 30.
  • Other values stay as text, and an empty value stays an empty string.
  • Lines without a separator are skipped.
  • If a key appears twice, the later value replaces the earlier one.

Text to JSON does not read nested structures or lists written in the text. Each key becomes one top-level field.

When to use a different tool

  • To check or pretty-print JSON you already have, use the JSON formatter.
  • To convert a table of rows, use CSV to JSON.
  • To produce XML from the same key-value text, use Text to XML.

Privacy

The text you paste is processed in your browser and is not sent to Toolpad's servers. Clearing the page removes it.

How text to JSON works

Each line is parsed as a key-value pair split by : or =. Numbers and booleans are automatically typed. Use this to quickly convert config files, notes, or clipboard data into structured JSON.