About

The JSON Formatter was created to help with debugging. As data expressed as JSON is often written without line breaks to save space, it became extremely difficult to actually read it. This tool hopes to solve the problem by formatting the JSON into data that is easily readable by human beings.

Let me know how I can improve it by sending an email my way.

November 2009
Changed hosts, service should be much faster now.
December 2008
Added a Select All button as requested and fixed url validation and   output bugs.
November 2008
Released a completely rewritten version of the JSON Formatter. Many improvements and new features such as multiple results, templates, more robust parser, improved error messages, validation, and resizable textareas. Thanks to everyone for their suggestions!
 
 

JSON Formatter

JSON Data:
Format Template:


Custom Template:
Validate:
 
JSON Data From URL:


ClearClear ProcessProcess
 
 
 

Learn About JSON

To learn more about JSON check out some of the links below

 

Validation

Following the description of JSON set out by Douglas Crockford of json.org in RFC 4627, a validation scheme has been implemented. If you experience any problems, please alert me.

 

Templates

In an attempt to appease everyone's tastes in how their JSON is format, templates are available. You can also build your own custom template if you like by following the specs below.

Each template is made up of 27 strings, which are seperated by the "|" pipe character. Each of these strings can contain <br> & <span> tags for formatting.

As JSON can be nested, the correct indentation can be achieved by placing an "[INDENT]" marker in the string. It will call the indent string (1) the correct number of times to achieve proper nesting. The indent is incremented after an opening objects/arrays brace/bracket, and decremented before a closing objects/arrays brace/bracket.

Below is an explination of what each string represents.

  1. Indent
  2. Before a colon
  3. After a colon
  4. Before a comma
  5. After a comma
  6. Before a object key
  7. After a object key
  8. Before an object value
  9. After an object value
  10. Before a array value
  11. After a array value
  12. Before an array value object opening brace
  13. After an array value object opening brace
  14. Before an array value object closing brace
  15. After an array value object closing brace
  16. Before an object value object opening brace
  17. After an object value object opening brace
  18. Before an object value object closing brace
  19. After an object value object closing brace
  20. Before an array value array opening bracket
  21. After an array value array opening bracket
  22. Before an array value array closing bracket
  23. After an array value array closing bracket
  24. Before an object value array opening bracket
  25. After an object value array opening bracket
  26. Before an object value array closing bracket
  27. After an object value array closing bracket

If you have any template that you would like added, shoot me an email.

 

Technologies

The backend is built with PHP, the frontend was built to XHTML/CSS standards with assistance from FAMFAMFAM Silk Icons, 960 Grid System, Prototype, & TextAreaResizer.

This site has been tested on Firefox 3, Chrome 0.3, IE 6, IE 7 and Opera 9.

 
 
curiousconcept.com