1. Technology
Send to a Friend via Email

Javascript Formatter

Related Articles

Javascript Compressor

Does your Javascript code look a mess? Are you trying to work out how someone else's Javascript does what it does but it is so messy you can't read it?

If you paste a copy of the script into the form below and then select the "Format" button then a nicely formatted copy will be displayed that uses consistent indenting and has all of the reserved words, predefined objects, comments, and literals all colour coded to make the code easier to follow.

Note that the form is only expecting to process Javascript so if you paste anything else (eg. HTML not enclosed within a string being assigned to innerHTML) then you will not get any meaningful results.


When the "Format" button is pressed your formatted output will appear below (with a different coloured background so that it will be obvious where the formatted code starts and finishes). Note that any lines too long to fit may require that you scroll horizontally to see the entire formatted content.

Related Video
How to Format Slides in PowerPoint
  1. About.com
  2. Technology
  3. JavaScript

©2014 About.com. All rights reserved.