Processed in your browser

XML / JSON5 Converter

Attributes, text, and repeated elements enter an explicit object mapping. JSON5 comments, quote choices, unquoted keys, and hexadecimal notation become data and cannot be reconstructed exactly.

Processed in your browser
0 / 1,000,000
Converted output

Tool guide

What is XML / JSON5 Converter?

XML and JSON5 Converter supports development settings, fixtures, and relaxed-syntax compatibility review. XML attributes, text, and repeated elements enter an explicit object structure, while JSON5 comments, single quotes, unquoted keys, and hexadecimal notation parse as data. Reverse conversion requires one root and rejects non-finite numbers. Common workflows include the following. Turn XML examples into commentable JSON5. Generate legacy XML from JSON5. Review attributes and repeated elements. The page also documents input boundaries, output behavior, and practical cautions so you can review the result before putting it into an application, configuration, test, or production workflow.

When to use it

  • Turn XML examples into commentable JSON5.
  • Generate legacy XML from JSON5.
  • Review attributes and repeated elements.

How to use it

  1. Identify the current input format.
  2. Confirm JSON5 has one XML root key.
  3. Use @attributes and #text for attributes and text.
  4. Convert and fix parser or root errors.
  5. Review comment and number normalization.
  6. Load one of the realistic examples first to verify the selected options and processing direction before replacing it with your own data.

Runnable examples

The “Example 1” and “Example 2” buttons load the matching inputs. They cover different structures, directions, or boundaries and can be run directly in the workspace.

Example 1

<site><name>JSONLane</name><release><tools>60</tools><ready>true</ready></release></site>

Example 2

// XML root object
{ site: { name: 'JSONLane', release: { tools: 60, ready: true, }, }, }

Input rules

  • XML rejects DTD and ENTITY declarations.
  • JSON5 to XML requires one root key.
  • Infinity, NaN, and dangerous keys are rejected.
  • Text input is counted before processing and is limited to 1,000,000 characters on this page; file modes apply the separate file limit shown in the workspace.
  • JSON5 comments, quotes, and hexadecimal notation are not retained.

Output rules

  • Attributes use @attributes and text uses #text.
  • JSON5 comments and quote choices are not retained.
  • XML namespaces and mixed content need review.
  • Output reflects only the current input, direction, and options; rerun after changing a mode or value instead of treating an earlier result as current.
  • JSON5 to XML requires one root key.

Limitations and cautions

  • JSON5 comments, quotes, and hexadecimal notation are not retained.
  • JSON5 to XML requires one root key.
  • XML comments, instructions, namespaces, and mixed content are not guaranteed.

How your data is handled

All parsing, format conversion, Base64 work, and intermediate data remain in the current browser tab. JSONLane does not upload the input or retain it after refresh or close.

FAQ

Is XML or JSON5 content uploaded?

No. Parsing, conversion, and output generation remain in the current browser tab.

Is every round trip lossless?

No. Comments, layout, type systems, and binary capabilities differ, so the page lists areas that require review.

Why can valid input still be rejected?

The destination may not have a safe, unambiguous representation. Dangerous keys, unsafe integers, excess depth, and ambiguous mappings are rejected.

Do JSON5 comments become XML comments?

No. Comments are not data values after parsing.

How are attributes written?

Use @attributes in the root object and #text for ordinary element text.

Can Infinity enter XML?

No. Non-finite values are rejected by the safe object model.

Updated: 2026-08-09