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
- Identify the current input format.
- Confirm JSON5 has one XML root key.
- Use @attributes and #text for attributes and text.
- Convert and fix parser or root errors.
- Review comment and number normalization.
- 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.