GGfor Tools

JSON Converter

Convert JSON to XML, YAML, or CSV -- and convert them back to JSON.

Convert structured data

Choose JSON on either side. Input is limited to 100,000 UTF-16 units; unsupported or lossy structures are rejected where detected.

JSON options

XML options

CSV options

Waiting for input...

JSON, XML, YAML and CSV conversion guide

Use this converter to format JSON and exchange structured data with XML, YAML or CSV. Every conversion has JSON as its input or output. To move from XML to YAML, first convert XML to JSON, then use the result as the next input. This is a data mapping tool, not a guarantee of identical round trips.

How to convert and check your result

Select the input and output formats, paste your text, adjust the relevant options and choose Convert. Selecting a non-JSON format automatically makes the other side JSON. Copy is enabled only for a successful current result. Editing data or options clears the old output. Use result as input moves a successful result into the input and reverses the formats.

JSON formatting and number accuracy

JSON accepts double-quoted keys and strings, arrays, numbers, booleans and null; comments and trailing commas are invalid. Duplicate object keys are rejected. Choose pretty printing with 0 to 8 spaces or compact output. Numbers use JavaScript floating-point arithmetic; unsafe integers and non-finite values are rejected, but decimal values can still round. Keep long IDs and exact decimal amounts as quoted strings.

XML mapping: roots, attributes and text

JSON to XML always wraps the data in the selected root element. Object keys become element names, arrays repeat the same child name, and a top-level array uses item elements. @attributes holds scalar attributes and #text holds scalar text. Text and attribute values are escaped. XML to JSON retains the root name, groups repeated children into arrays and keeps leaf text as strings under #text. Leaf whitespace is retained; formatting whitespace between elements is ignored.

XML limitations to review before conversion

This simplified mapping rejects mixed text with child elements, empty arrays on XML output, namespaces, DTDs and entity declarations. Names use an ASCII subset and cannot start with xml. XML comments and processing instructions are omitted; CDATA becomes ordinary text. XML does not retain JSON scalar types: null and empty containers may share an empty-element representation. Root wrappers can accumulate when reversing a conversion. Do not use this tool for a lossless XML archive.

CSV headers, delimiters and flat records

CSV input supports quoted delimiters, doubled quotes and line breaks inside quoted fields. Use one delimiter character, or type \t for a tab. With headers enabled, names must be unique and non-blank; otherwise columns are named col1, col2 and so on. Every row must have the same field count. Field spaces are retained, and a final line break does not add an extra record. CSV values remain strings.

Preparing JSON for CSV export

CSV output accepts one non-empty flat object or an array of flat objects, with the union of their keys as columns. Nested objects and arrays are rejected. Missing values and null become empty fields; scalar types are rendered as text, so converting back will not restore their types. Headers are optional and output uses CRLF line endings. CSV quoting does not neutralize spreadsheet formulas: review untrusted cells before opening the result in a spreadsheet.

JSON

[{"name":"Alice","active":true},
 {"name":"Bob","active":false}]

CSV

name,active
Alice,true
Bob,false

YAML support and conversion boundaries

YAML uses a locally hosted js-yaml library with its JSON-compatible schema. Use a single document with unique string keys and JSON-compatible values. Schema names do not imply identical JSON number syntax. Comments, style and anchors are not preserved in JSON. Cyclic aliases, unsupported types and oversized alias expansions are rejected. YAML output uses at least two spaces of indentation.

Limits, stopping and local processing

Conversion runs in a separate Worker with a 3-second deadline including startup; Stop terminates it. Limits are 100,000 input UTF-16 units, 40 nesting levels, 20,000 data entries and 1,000,000 output units. YAML parsing and XML tree checks can reach limits earlier. XML first uses the browser XML parser on the bounded input. The conversion function does not upload text or store it in browser storage; shared site resources still load. Textareas may normalize input line endings.