Skip to main content

SOML to JSON

Convert SOML to formatted JSON in your browser. Preserve integer digits, get a notice for type changes, and copy or download the result.

Input
SOML
Output
JSON

What is a SOML to JSON converter?

A SOML to JSON converter turns a SOML configuration document into JSON you can use in an API request, test fixture, or application that expects JSON. The output uses two-space indentation and keeps the document’s objects and arrays.

Some SOML values have no equivalent JSON type. Dates, timestamps, and durations become strings that keep their original spelling. The converter reports when it makes that change. See the SOML draft specification for the source format’s value types and syntax.

How to convert SOML to JSON

  1. Paste SOML, open a UTF-8 .soml or .txt file, or select Example.
  2. Select Convert.
  3. Review the result and any notices about type changes or large integers.
  4. Select Copy to copy the result or Download to save a .json file.

The converter accepts up to 1 MiB of input. Conversion runs in your browser.

SOML to JSON example

# Deployment settings
service: 'api'
launch-date: 2027-01-15
released-at: 2027-01-15T09:00:00Z
timeout: 30s
flags: 0xFF
build-id: 9007199254740993

JSON output:

{
"service": "api",
"launch-date": "2027-01-15",
"released-at": "2027-01-15T09:00:00Z",
"timeout": "30s",
"flags": 255,
"build-id": 9007199254740993
}

The timeout keeps its unit in the string "30s". The hexadecimal value 0xFF becomes the decimal number 255, and the comment is omitted. If the receiving API expects a timeout as a number, check which unit it expects before changing the value.

What changes when SOML becomes JSON?

SOML inputJSON result
Objects and arraysKeep their structure. JSON adds braces around an unbraced root object, quotes keys, and separates entries with commas.
Strings, booleans, and nullKeep their value and use JSON syntax.
IntegersBecome decimal numbers with all digits preserved.
Finite floatsBecome JSON numbers.
Dates, timestamps, and durationsBecome strings with the original spelling.
CommentsAre omitted because JSON has no comment syntax.
infinity and -infinityProduce an error because neither can be represented as a JSON number.

Keeping every digit in the file does not guarantee the same precision after parsing it. A program using JavaScript’s ordinary number type can round integers beyond the safe range. For instance, JSON.parse reads 9007199254740993 as 9007199254740992. Use a reader that supports exact large integers if those digits matter downstream.

Troubleshooting

Why is my SOML file rejected?

Check the reported line and column for syntax errors such as an unquoted string value, a duplicate key, or a missing closing bracket. For example, write service: 'api' to store api as text. If a file fails because it uses CRLF line endings, save it with LF line endings and open it again.

How can I convert a config that uses infinity?

Decide what the receiving program can use to represent an unlimited value. If it expects a string such as "unlimited" or an explicit null, change the source value accordingly before converting. The tool does not choose a replacement for you.

SOML to JSON FAQ

Can I turn the JSON back into the original SOML?

JSON to SOML converts the result back into SOML syntax. Comments stay omitted, and converted dates, timestamps, and durations stay strings. Keep the original SOML file if you need those comments or value types.

How can I inspect a nested result?

Paste the result into JSON Viewer to navigate its objects and arrays. For exact large integers, refer to the digits in the converter output and check how your target application parses them.