Related Tools
The JSON5 Beautify / Validator Online tool provides online json5 format verification, json5 format, json5 data compression and json5 data beautification functions.
The JSON5 Data Interchange Format (JSON5) is a superset of JSON that
aims to alleviate some of
the limitations
of JSON by expanding its syntax to include some productions from ECMAScript 5.1.
Note : The JSON5 specification allows optional trailing commas in objects and arrays. Therefore, the Validate & Beautify function will retain the trailing comma. The Compress function does not retain the trailing comma. If you need to remove the trailing comma from the data, you can use the Compress function.
Note : The JSON5 specification allows optional trailing commas in objects and arrays. Therefore, the Validate & Beautify function will retain the trailing comma. The Compress function does not retain the trailing comma. If you need to remove the trailing comma from the data, you can use the Compress function.
Summary of Features
The following ECMAScript 5.1 features, which are not supported in JSON, have been extended to JSON5.
Objects
- Object keys may be an ECMAScript 5.1 IdentifierName.
- Objects may have a single trailing comma.
Arrays
- Arrays may have a single trailing comma.
Strings
- Strings may be single quoted.
- Strings may span multiple lines by escaping new line characters.
- Strings may include character escapes.
Numbers
- Numbers may be hexadecimal.
- Numbers may have a leading or trailing decimal point.
- Numbers may be IEEE 754 positive infinity, negative infinity, and NaN.
- Numbers may begin with an explicit plus sign.
Comments
- Single and multi-line comments are allowed.
White Space
- Additional white space characters are allowed.