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– DanielFeb 27, 2013 at 22:08
-
Over 61k times now, so about 4k views in the last month. Yes, definitely not a constructive question.– PaulApr 2, 2013 at 13:50
-
Not sure why this topic was closed, but 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 BucklinMay 19, 2013 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/
-
1Can you suggest any formatter which follow PSR-2 code standard for PHP? Feb 2, 2016 at 0:33
-
For SQL formatting there is the free online Formatter SQLinForm sqlinform.com/sql_formatter_online.html– GuidoJun 19, 2016 at 18:44
-
-
or use pastebin and highlight code for a variety of languages - pastebin.com– TarunJul 5, 2016 at 8:29
-
For VB indentation: warp.senecac.on.ca/timothy.mckenna/CodeFormatter.asp Feb 16, 2017 at 22:26
For PHP, Java, C++, C, Perl, JavaScript, CSS you can try:
-
12Did you actually try this one? It outputs
>
for>
and similar. May 10, 2011 at 2:27 -
I think that is because those will be embedded inside another html page, as a sample, etc, and really should be.– AndrewNov 2, 2011 at 10:24
-
It outputs < for
<
...– user1537415Mar 9, 2013 at 16:59
JsonLint is good for validating and formatting JSON.
-
1
-
If you're using Chrome, there's a great json formatter extension at chrome.google.com/webstore/detail/… May 15, 2012 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.
-
4Since the question asked for "online beautifier", do you know of any Web frontends to indent?– AnmAug 10, 2012 at 4: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.
-
1
-
-
@Glorfindel Thank you for the edit. I thought I lost those images for good.– VonCFeb 7, 2019 at 18:02
I've used Quick Highlighter a lot. Works great for a huge list of languages.
-
12-1 OP didn't ask about highlighters. This doesn't do formatting/beautifying.– bluishMay 3, 2011 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"
-
1Dude, it's really beautiful. I'd choose this as the answer :-) Thanks…– user1521536Nov 10, 2012 at 14:19
-
3
-
that is correct, it is a code beautifier and code snippets storage. It has some cool features (like share, star and private snippets). Nov 16, 2012 at 6:51
-
1
-
13