Key-value pairs to code
Turn key=value or key: value lines into JSON, YAML, .properties, .env, TypeScript, Python, PHP, Java, C#, Go, HTML options or SQL.
Process locally
Files stay in this browser session. Closing or clearing releases them.
Add text
Type or paste the text to process
Adjust settings
Optional: Separator, Code, Variable or table name and more
Run
Processes in this browser; cancel at any time
About this tool
Turn lines of key=value or key: value into code or config: JSON, YAML, .properties, .env, a TypeScript or JavaScript object, a Python dict, a PHP array, a Java Map, a C# Dictionary, a Go map, HTML <option> tags or a SQL INSERT. Use it to move settings between formats, fill a dropdown from a list, or turn a config dump into test data.
The separator can be detected for you, values can stay text or be written as numbers, true/false and null, and blank lines and comment lines are skipped. Up to 1 MB of text is converted in your browser and is not uploaded.
How to use it
- Enter one key and value per line, such as name=Alice or city: Shanghai, or select “Use example”.
- Choose the “Separator”, or leave it on “Detect”, and pick the output format under “Code”.
- Set the “Variable or table name” (data by default), and tick “Write numbers, true/false and null without quotes” if you want typed values.
- Select “Run”, then preview the code and download it with the matching extension, such as code.json or code.py.
Formats and limits
- Input
- Text
- Output
- Text
- Size limit
- 1 MB
- Settings
- Separator (Detect, =, :, Tab, Comma, Space); Code; Variable or table name; Write numbers, true/false and null without quotes
- Privacy
- Files stay in the current browser session. No file bytes are uploaded.
- Price
- Free, no sign-up
Common questions
How is the separator detected?
“Detect” tries =, then tab, then a colon (: or :), then a comma (, or ,), then spaces, and uses the first one found in every line. Each line is split at its first separator only, so with = a value such as https://example.com keeps its colons.
Which lines are skipped?
Blank lines and lines starting with #, // or ; are treated as comments and ignored. Quotes around a value are removed, so name='Alice' gives Alice.
Which formats write typed values?
With the option ticked, JSON, YAML, TypeScript, JavaScript, Python, PHP and SQL write numbers, true/false and null without quotes. .properties, .env, Java, C#, Go and HTML options always keep values as text, and the Java, C# and Go maps are declared with string values.
What happens to keys in .env and .properties?
.env keys are turned into upper case with other characters replaced by _, so api-url becomes API_URL. In .properties, non-ASCII characters such as Chinese are written as \uXXXX escapes.
What if a key appears twice?
JSON keeps only the last value for that key. The other formats write every line as it is.
Related tools
JSON to code types
Generate TypeScript interfaces, C# classes, Java records, Go structs, Rust serde structs or Python dataclasses from sample JSON. Fields missing from some samples become optional.
JSON, YAML and XML converter
Validate, pretty-print or convert between JSON, YAML and XML for their shared subset. External entities and custom tags are rejected.
Code formatter
Format or minify HTML, CSS, SCSS, Less, JavaScript, TypeScript, JSON, Markdown, YAML, XML, SQL, C, C++, C#, Java, PHP, Python and nginx configuration.
JSON format and validate
Format, minify or sort JSON, repair common mistakes, or escape it as a string. Errors show the line and column, and large numbers keep every digit.
URL parse and query convert
Split a URL into its parts and parameters, turn a query string into JSON, or build a query string from a JSON object.
Convert dates and time zones
Convert one date-time per line between ISO 8601, Unix time and local time in named time zones. Daylight-saving gaps and repeats are reported.