This is by far the best I've come across: http://jsbeautifier.org/
Available as an online tool, or on the command-line using node.js or python. The source code is available.
Answer from eozzy on Stack OverflowJSON Formatter
jsonformatter.org › jsbeautifier
Best JSBeautifier to beautify / format JavaScript
This Javascript Beautifier that supports indentation levels: 2 tab spaces, 3 tab spaces, and 4 tab spaces. Download JS, once it's formatted, created or modified and this js file can be opened in Sublime, VSCode, and Notepad++ alternative. Best and Secure Online Javascript Formatter and Javascript Beautifier works well in Windows, Mac, Linux, Chrome, Firefox, Safari, and Edge.
Beautifier
beautifier.io
Online JavaScript beautifier
Chrome, in case the built-in CSS and javascript formatting isn't enough for you: — Quick source viewer by Tomi Mickelsson (github, blog), — Javascript and CSS Code beautifier by c7sky, — jsbeautify-for-chrome by Tom Rix (github), — Pretty Beautiful JavaScript by Will McSweeney — Stackoverflow Code Beautify by Making Odd Edit Studios (github).
Videos
11:20
How to Format Code Automatically with Prettier and VS Code - YouTube
16:26
Formatting JS code with prettier - part 1: the editor - YouTube
07:38
Auto Code Formatting in VSCode | Best Formatter for Visual Studio ...
11:02
Prettier Javascript for Best Code Formatting | Prettier vs Eslint ...
01:38
VS Code tip — Configuring JavaScript and TypeScript formatting ...
Top answer 1 of 7
15
This is by far the best I've come across: http://jsbeautifier.org/
Available as an online tool, or on the command-line using node.js or python. The source code is available.
2 of 7
12
In one breath: Aptana Studio! Yes, it's Java based and free (Eclipse, as standalone or plugin).
You can also customize the formatting.
Prettier
prettier.io
Prettier · Opinionated Code Formatter · Prettier
Your code is formatted on save · No need to discuss style in code review · Saves you time and energy · And more » · JavaScript · JSX · Flow · TypeScript · JSON · CSS · Less · SCSS · styled-components 💅 · styled-jsx · HTML · Vue · Angular · Ember / Handlebars ·
GoOnlineTools.com
goonlinetools.com › js-formatter
Javascript Formatter - Beautify Javascript Code Online
This Best free online Javascript Formatter Beautify ugly, minified Javascript code and give it proper indentation to make it more readable.
Biome
biomejs.dev
Biome, toolchain of the web
Biome is a fast formatter for JavaScript, TypeScript, JSX, TSX, JSON, HTML, CSS and GraphQL that scores 97% compatibility with Prettier, saving CI and developer time.
FreeFormatter
freeformatter.com › javascript-beautifier.html
Free Online Javascript Beautifier / Formatter - FreeFormatter.com
Formats JavaScript files with the chosen indentation level and your choice of braces. Supports 4 indentation levels: 2 spaces, 3 spaces, 4 spaces and tabs.
Formatter.org
formatter.org › javascript-formatter
JavaScript Formatter Online – Beautify and Format JavaScript Code
JavaScript Formatter is a tool used for formatting JavaScript code according to best practices and coding standards. It can help improve code readability and maintainability by automatically formatting the code with consistent indentation, spacing, and other formatting rules.
GitHub
github.com › beautifier › js-beautify
GitHub - beautifier/js-beautify: Beautifier for javascript · GitHub
This little beautifier will reformat and re-indent bookmarklets, ugly JavaScript, unpack scripts packed by Dean Edward’s popular packer, as well as partly deobfuscate scripts processed by the npm package javascript-obfuscator.
Author beautifier
10bestdesign
10bestdesign.com › dirtymarkup › js
DirtyMarkup Beautifier - Javascript Formatter, JS Tidy Up
A free tool to clean up your dirty Javascript code. DirtyMarkup is brings you an online JS beautifier, plus an API to tidy up your code in an application.
Minifier
minifier.org › javascript-beautifier
Best Online JavaScript Beautifier / Formatter
Use our online JavaScript Beautifier to clean, format, and structure your code. Improve readability, fix indentation, and beautify JS quickly.
Copahost
copahost.com › home › javascript beautifiers: the best 5 tools available
JavaScript beautifiers: The best 5 tools available - Copahost
July 16, 2023 - We can directly paste or upload the code and press the Beatify javascript button to beatify the code. It’s very simple. We also have the options for copy and selecting all. ... 2. There are a lot many options for formatting, encoding, decoding, beautifying on this website only. We don’t need to open other sites for such options. 3. We can directly upload a file instead of copy and pasting. This is a convenient way if the code contains way too many lines. ... The codebeautify is one of the best beautifier present on the internet.
Reddit
reddit.com › r/javascript › [askjs] any javascript library to format some strings of code like prettier?
r/javascript on Reddit: [AskJS] Any Javascript Library to format some strings of code like prettier?
April 8, 2024 -
I was looking for something that will autoformat python, C++, C#, typescript string of codes so I can autoindent codes and push it back to codemirror or monaco editor like prettier,
Top answer 1 of 3
2
For JS and TS: e.g. prettier For Python there are e.g. autopep and black For c++: e.g. clang-format There are lots of other tools out there to do this. Just Google for formatter + language you want to format. Since you are asking on the js sub, you probably want js packages. That could be more challenging to find, but keep in mind there's often a way to do interop between languages.
2 of 3
1
CSharpier
Reintech
reintech.io › blog › best-tools-for-linting-formatting-javascript-code
What are the best tools for linting and formatting JavaScript code? | Reintech media
February 2, 2023 - This configuration runs ESLint and Prettier on staged files before each commit, preventing improperly formatted code from entering your repository. For continuous integration, add a linting step to your CI pipeline: # GitHub Actions example - name: Lint code run: | npm run lint npm run format:check · Most production JavaScript projects benefit from this proven stack:
Text Cleaner
textcleaner.net › home › javascript formatter
JavaScript Formatter Online, JS Formatter / Beautifier
January 13, 2022 - Step 3: If you’ve done it correctly, the formatted JavaScript code should now appear in the output box (bottom side). Step 4: Feel free to use the quick copy button to copy the code. It’s the best JavaScript formatter online tool to format/beautify your JavaScript.
npm
npmjs.com › package › js-beautify
js-beautify - npm
This little beautifier will reformat and re-indent bookmarklets, ugly JavaScript, unpack scripts packed by Dean Edward’s popular packer, as well as partly deobfuscate scripts processed by the npm package javascript-obfuscator.
» npm install js-beautify
Published Feb 27, 2025
Version 1.15.4
Author Einar Lielmanis
Repository https://github.com/beautifier/js-beautify
Homepage https://beautifier.io/