Online Code Syntax Checkers and Formatters
By John Negoita on Thursday, Jul 12, 2018
Code syntax checkers and formatters are tools that any web developer should keep close. Code syntax validation and code formatting are tasks that are part of all developers workflow.
You know how it is,
Either you take over code written by somebody else, or code is generated from various applications. Manual source code review is not really fun. Even if you know how to fix syntax errors, wouldn’t it be more efficient to let an automated tool do it?
So, let’s dig into our list of formatters and syntax checkers for web developers.
- JSON Lint - JSON Formatter And Validator
- CSS Lint - CSS Validator And Corrector
- PHP Code Syntax Checker - Check Syntax for PHP Code
- SQL Formatter - Format SQL statements
Now that you have this list, don’t forget to bookmark this page. You can come back to it anytime you need a list with the best formatters and validators online. Let’s take a quick look at the code formatters and validators and see what they do.
1. JSON Lint
JSON Lint is a JSON validator and formatter that I use all the time. I’m working with REST APIs all the time.
JSON communication with REST end points is very common today in web applications. However, if the JSON passed around is relatively big, trying to inspect and read it will become a hassle. Just copy/paste the JSON text into JSONLint and press the Valiate JSON button.
This will do 2 things:
- It will format the JSON text adding indents. This is also called JSON pretty print.
- It will validate the JSON content and indicate how to correct any JSON syntax issues.
2. JS Beautifier
Use JSBeautifier as a HTML code checker and fixer.
3. CSS Lint
CSS Lint is an inline css checker tool that is really fun to use. Copy/paste your CSS code in it and press the Lint button. This will check your CSS code and indicate if there are any issues with it. Also it will format the CSS code for easy reading.
4. PHP Code Syntax Checker
PHP Code Syntax Checker is a php code checker and fixer. It will parse your PHP code and indicate errors in it.
5. JS Hint
Additionally, you can toggle specific options in the Configure menu.
6. SQL Formatter
SQL Formatter is a free online formatter for SQL statements. Enter your SQL statement in the textarea and click Format SQL. To upload a file use the button right below the textarea.
In addition to the web interface SQLFormat provides an API. Or you can download the Python module that powers this service to use it in your own applications.