What are the best online code beautifier and formatter out there? I'm not asking for highlighters. Any language will do.
-
7viewed over 57k times... good thing you guys got on top of it and closed this – Daniel Feb 27 '13 at 22:08
-
Over 61k times now, so about 4k views in the last month. Yes, definitely not a constructive question. – Paul Apr 02 '13 at 13:50
-
Not sure why this topic was closed, but http://tohtml.com/javaProperties/ worked well for me. The styles and color are "inline" which makes it very simple to copy and paste into something else. – Andrew Bucklin May 19 '13 at 16:30
8 Answers
CSS: code beautifier
HTML: HTML Tidy, CleanUp HTML or the general purpose Pretty Diff
Javascript: http://jsbeautifier.org/
PHP: http://beta.phpformatter.com/
SQL: http://dpriver.com/pp/sqlformat.htm
XML: http://chris.photobooks.com/xml/default.htm
Colour all: http://quickhighlighter.com/

- 3,308
- 2
- 37
- 67

- 802
- 2
- 11
- 26
-
1Can you suggest any formatter which follow PSR-2 code standard for PHP? – Vipul Hadiya Feb 02 '16 at 00:33
-
For SQL formatting there is the free online Formatter SQLinForm http://www.sqlinform.com/sql_formatter_online.html – Guido Jun 19 '16 at 18:44
-
-
or use pastebin and highlight code for a variety of languages - http://pastebin.com/ – Tarun Jul 05 '16 at 08:29
-
For VB indentation: http://warp.senecac.on.ca/timothy.mckenna/CodeFormatter.asp – Michael Armes Feb 16 '17 at 22:26
-
For PHP, Java, C++, C, Perl, JavaScript, CSS you can try:

- 4,870
- 6
- 36
- 50
-
12Did you actually try this one? It outputs `>` for `>` and similar. – Ponkadoodle May 10 '11 at 02:27
-
I think that is because those will be embedded inside another html page, as a sample, etc, and really should be. – Andrew Nov 02 '11 at 10:24
-
-
1
-
If you're using Chrome, there's a great json formatter extension at https://chrome.google.com/webstore/detail/bcjindcccaagfpapjjmafapmmgkkhgoa – David Woods May 15 '12 at 22:09
What language?? There are different tools for almost every imaginable programming language, since they all have different syntactic rules and conventions.
Good ol' indent
is a nice, customizable, command-line utility to format C and C++ programs.

- 76,929
- 13
- 76
- 124
-
4Since the question asked for "online beautifier", do you know of any Web frontends to indent? – Anm Aug 10 '12 at 04:48
It depends of the language, and of the architecture you are using.
For example, in a php platform, you can format almost language with GeSHi
As bluish comments, GeSHi is a generic syntax highlighter, with no beautification feature. It is more used on the server side, and combine it with a beautification tool can be tricky, as illustrated with this GeSHi drupal ticket.

- 21,988
- 13
- 81
- 109

- 1,262,500
- 529
- 4,410
- 5,250
-
1
-
-
@Glorfindel Thank you for the edit. I thought I lost those images for good. – VonC Feb 07 '19 at 18:02
I've used Quick Highlighter a lot. Works great for a huge list of languages.

- 16,087
- 8
- 51
- 67
-
12-1 OP didn't ask about highlighters. This doesn't do formatting/beautifying. – bluish May 03 '11 at 12:56
Use gist.github.com. There is a multi-language support(java, c, c++, c#, vb, haskell, ruby, javascript, lua, HTML, SQL, Tcl, Perl, JSON, groovy...)
Here is a sample "Generate LiquiBase changeLogs using Groovy"

- 338
- 3
- 7
-
1
-
3
-
that is correct, it is a code beautifier and code snippets storage. It has some cool features (like share, star and private snippets). – rayyildiz Nov 16 '12 at 06:51
-
1
-
13