Text to JSON converter

Convert plain key:value text into structured JSON or XML. Paste config files, form data, or notes in key: value format and get clean JSON or XML output instantly.

Plain text input

JSON output

How the text to JSON converter works

This tool parses plain text in key: value format — one pair per line — and converts it into a structured JSON object. Spaces around the colon are ignored. Numbers are automatically converted to numeric types; everything else becomes a string.

Input format

Each line should be a key: value pair. Keys with spaces are converted to underscores. Examples:

Use cases

API access

Convert programmatically: POST /api/v1/datatools/convert/text-to-json with body {"input": "name: John\nage: 30"}

For XML: POST /api/v1/datatools/convert/text-to-xml with optional "rootTag": "record"

What if a value contains a colon? +
The parser splits on the first colon only. So url: https://example.com correctly produces "url": "https://example.com".
Can I convert multi-level / nested data? +
This tool handles flat key:value structures. For nested JSON, use the JSON formatter directly or structure your data as JSON first. Nested conversion from plain text is not supported in this version.