Code Style Checker

Pick a language, pick a published style guide, and see which lines break its rules. The same file scores differently under Airbnb than under StandardJS, and the checker shows you exactly where the two disagree.

Source file

The vertical guide marks the column limit for the guide you picked.

Findings by rule

Open a rule to read why it exists, then click a line number to jump the cursor.

Nothing checked yet

Pick a language and a style guide, paste a file, then run the check. Findings group by rule, and every line number jumps the cursor there.

Style rules are agreements, not facts. A file with tab indentation is correct in a WordPress plugin and wrong in a Google Java project. This page runs the rules from published guides, names the guide behind every finding, and points at the line.

Four kinds of tool, four different questions

Teams reach for the phrase style checker to mean four things at once. They answer separate questions and run at separate moments, so knowing which one you need saves an argument in review.

Kind of toolQuestion it answersTypical exampleWhen it runs
FormatterHow should this file be laid out? It rewrites without asking.Prettier, Black, gofmtOn save, or as a pre-commit hook
Style checkerWhich lines break the written convention?This page, PHP_CodeSniffer, pycodestyleBefore review, or in the pipeline
LinterWhich lines look like bugs waiting to happen?ESLint rules such as no-unused-varsIn the editor as you type
Compiler or type checkerIs this code even valid?tsc, javac, mypyOn every build

Everything on this page belongs to the middle two rows. A compiler will happily accept three space indentation, a missing final newline, and a class named invoice_builder. None of it stops the build, and all of it slows down the next person reading the file.

Why the same file passes one guide and fails another

Load the JavaScript sample, run it under Airbnb, then switch to StandardJS. Errors appear and disappear without you touching a character. StandardJS drops the statement semicolon, so lines Airbnb marks as broken become correct, and the semicolons Airbnb wants become findings of their own.

Here is what each preset actually enforces.

GuideLanguageColumnsIndentDistinctive rule
AirbnbJavaScript, TypeScript1002 spacesSemicolons required, single quotes
StandardJSJavaScript, TypeScriptnone2 spacesSemicolons dropped, no column limit at all
Prettier defaultsJavaScript, TypeScript802 spacesDouble quotes, semicolons required
WordPressJavaScript, CSS, HTMLnonetabsThe one preset here where a space indent is the finding
PEP 8Python794 spacesTwo blank lines before a top level definition
BlackPython884 spacesPEP 8 rules with a wider line, which is Black's one deliberate break
PSR-12PHP1204 spacesClass and function braces go on their own line
PSR-2PHP804 spacesSame brace rules, tighter column budget
Google Java StyleJava1002 spacesOpening brace stays at the end of the line
Oracle conventionsJava804 spacesThe older Sun document, still common in enterprise code
MicrosoftC#1204 spacesOpening brace goes on its own line, the opposite of Java
Idiomatic CSSCSS802 spacesLower case hex, one declaration per line

The brace disagreement is the clearest example

Paste the same block into the Java pane and the C# pane. Google Java Style flags a brace sitting alone on a line. Microsoft flags a brace sitting at the end of a line. Two guides, two respected vendors, exactly opposite verdicts on identical code.

// Google Java Style wants this
public double total(double[] prices) {return 0;}
public double Total(double[] prices){return 0;}

Neither is better. What breaks a codebase is a file holding both, because every diff then carries brace churn from whoever last opened it.

Where the column numbers came from

The 79 in PEP 8 traces back to an 80 column terminal, minus one so a wrapped line stays visible. Linux kernel style kept 80 for the same reason. Airbnb moved to 100 once wide monitors became normal, and Black picked 88 after measuring that a slightly wider limit reduced the number of forced line breaks in real code. Modern limits protect side by side diffs and code review panes, not hardware.

Every rule the checker runs

Nothing here is hidden. These are the checks, the severity each one carries, and the pattern behind it.

Rules applied to every language

Rule idLevelWhat triggers it
line-lengthWarningRaw line exceeds the guide's column count. Skipped entirely for guides with no limit.
trailing-whitespaceNoteSpace or tab at the end of a line, including whitespace sitting on an otherwise blank line.
indent-charWarningLeading whitespace uses the character the guide rejects. Raised to an error in Python.
mixed-indentErrorOne line opens with both a tab and a space.
indent-sizeNoteLeading space count is not a multiple of the guide width, on a line that is not a bracket continuation.
blank-linesNoteMore consecutive blank lines than the guide allows.
final-newlineNoteThe pasted text does not end in a newline character.

JavaScript and TypeScript

Rule idLevelWhat triggers it
no-varErrorA var keyword outside a string or comment.
semiErrorA statement line ending without a semicolon, or carrying one when the guide drops them.
eqeqeqWarningA double equals or not equals comparison. Comparisons against null are left alone.
no-consoleWarningA call to log, debug, info, dir, or trace. warn and error pass, since most teams keep them.
keyword-spacingNoteNo space between if, for, while, switch, or catch and the opening parenthesis.
brace-spacingNoteA closing parenthesis pressed against the opening brace.
camelcaseNoteA declared identifier carrying an underscore, excluding names in full upper case.
quotesNoteA string using the quote the guide does not prefer. Skipped when the other quote appears inside the value, and template literals are never flagged.
multi-spacesNoteTwo or more spaces inside a statement, past the indentation.

Python, PHP, Java, and C#

Rule idLanguageWhat triggers it
snake-casePythonA def name carrying a capital letter, dunder names excepted.
pascal-casePython, PHP, Java, C#A class or type name that does not open with a capital letter.
operator-spacingPythonA statement level assignment with no space before the equals sign.
blank-before-defPythonA top level def or class without two blank lines above it, decorators excepted.
wildcard-importPythonA from module import * line.
no-printPythonA print call at the start of a statement.
php-short-tagPHPAn opening tag that is not the full form, and is not the echo shorthand.
php-close-tagPHPA closing tag alone on a line.
php-elseifPHPAn else if written as two words.
php-lowercasePHPTRUE, FALSE, or NULL in upper case.
brace-stylePHP, Java, C#Brace placement that contradicts the selected guide, in either direction.
camelcasePHP, Java, C#A method name breaking the casing the language convention expects.
no-consoleJava, C#A System.out or Console.Write call left behind.

CSS and HTML

Rule idLevelWhat triggers it
css-missing-semiWarningThe last declaration in a block has no semicolon, so appending a property below it silently breaks the rule.
css-duplicateWarningThe same selector opens twice in the file. The finding names the earlier line.
css-importantWarningAn important flag anywhere in the declaration.
css-hexNoteUpper case hex, or a six digit value that shortens to three.
css-zero-unitNoteA zero carrying px, em, rem, percent, vh, vw, or pt.
css-colon-spaceNoteAn upper case property name, or a value pressed against the colon.
html-altErrorAn image element with no alt attribute at all.
html-quotesWarningAn attribute value that is not wrapped in quotes.
html-lowercaseNoteAn element name written with capital letters.
html-inline-styleNoteA style attribute on an element.

How the file is read before any rule runs

Naive line matching produces findings nobody wants. A URL inside a string holds a double slash, and a checker looking for comments finds one there. A comment mentioning var gets reported as a declaration. This page runs two passes before the rules see anything.

Strings and comments come out first

Every line goes through a small scanner that tracks quote state and block comment state across line boundaries. Comment text is blanked. String bodies are replaced with a filler character, so the string still occupies its columns without its contents matching anything. Block comments and Python triple quoted strings carry their state to the next line, which means a rule word inside a docstring stays quiet.

// none of these are findings
const note = "watch out for var and console.log here";const url = "https://cdn.toolexe.com/a//b";

Continuation lines are tracked by bracket depth

A running count of open parentheses and square brackets tells the checker whether a line finishes a statement or continues one. Any line sitting inside an unclosed bracket is exempt from the semicolon, indent width, and multiple space rules. This is what stops a wrapped function call from producing three findings for a single statement.

const payload = buildRequest(endpoint,{ retries: 3 },signal);

The first line opens a bracket, so the three lines under it are treated as continuation. Only the closing line is checked for its semicolon.

Where this checker gets things wrong

Read this before you file a ticket against one of its findings.

A clean result means no implemented rule matched. It says nothing about naming that reads badly, a function doing four jobs, or a comment that stopped being true two releases ago. Those need a reader.

What the whitespace fix touches, and what it refuses to

The Fix whitespace button rewrites four things and stops there.

  1. Indentation is re-expressed at the guide's character and width. The file's own indent step is measured from its narrowest indented line, then every line is rewritten at the same nesting level. A three space Python file becomes four space, and a two space JavaScript file becomes tab indented under the WordPress preset without any line losing a level.
  2. Trailing spaces and tabs are stripped from every line.
  3. Runs of blank lines are collapsed to the guide maximum.
  4. Blank lines at the end of the file are removed and one final newline is added.

It never reorders code, never inserts a semicolon, and never renames anything. Running it twice on the same file reports zero changes the second time, so a count of zero means the whitespace already matches the guide.

Two cases deserve a look before you click. A continuation line you aligned by hand under an opening bracket gets re-indented to the nearest whole level, which is the one place the button undoes deliberate alignment. And in a Python file that already mixes tabs and spaces, rewriting indentation changes which lines sit in which block. Clear the mixed indentation errors by hand first, then run it.

Getting a style rule to stick in a real team

Checking one file in a browser is the smallest version of this. Making it hold across a repository takes four steps, in this order.

  1. Write down the choice. An .editorconfig file at the repository root gives every editor the indent character, indent width, and final newline rule. It is the cheapest step and the one most often skipped.
  2. Put a formatter on save. Prettier, Black, or PHP CS Fixer removes the entire formatting category from human review. Nobody should be typing brace placement notes into a pull request.
  3. Reformat once, in its own commit. Mixing a repository wide reformat with a behaviour change makes the diff unreviewable. Land formatting alone, then add the hash to .git-blame-ignore-revs so blame keeps pointing at the author who wrote the logic.
  4. Fail the build, not the reviewer. Run the checker in the pipeline. A machine saying the indentation is wrong costs nothing. A colleague saying it costs goodwill twice a week.

The order matters. Teams that add the CI gate before landing the reformat get a red pipeline on every branch, and the rollout dies in the first week.

Reading the three levels

Error

The guide states this outright, and the fix carries no judgment call. Mixed indentation, a var declaration, a missing image alt attribute.

Warning

Worth changing, with cases where you would not. A long line holding one unbreakable URL is the standing example.

Note

Preference. Quote style, hex shorthand, a print call in a script that only ever runs by hand.

Counts are counts, not a score. Twelve notes about quote style is a formatter run away from zero. One mixed indentation error in a Python file is a runtime failure waiting to happen. Sort by what a finding costs you, not by how many there are.

Where this page fits next to the others

Style findings answer whether a file matches a convention. They say nothing about whether the code underneath is any good. When the formatting is settled, the Code Complexity Analyzer shows which functions carry too many branches, and the Code Smell Detector looks for the structural patterns that survive any amount of tidy indentation.

For a syntax error rather than a style break, the JavaScript Syntax Checker parses the file properly and reports the failure position. Security concerns run on a separate ruleset in the Code Security Scanner, and turning any of this into a repeatable team habit starts with the Code Review Checklist Generator.

Guide settings were checked against the published Airbnb, StandardJS, Prettier, PEP 8, Black, PSR-12, Google Java Style, and Microsoft C# documents in August 2026. All checking runs in your browser. No code is uploaded, stored, or logged by Toolexe.

Questions about the findings

Answers about how this page behaves, not general style guide theory.

Does my code leave the browser?

No. Every rule runs in JavaScript on the page in front of you. There is no upload, no API call, and no storage. Turn off your connection and the checker keeps working.

Why did switching the style guide change the number of errors without me editing anything?

Because the guides disagree. StandardJS drops the statement semicolon that Airbnb requires, WordPress indents with tabs where Google indents with spaces, and Microsoft C# puts a brace where Google Java Style refuses to. The file did not change, the rules did.

Is this the same as running ESLint or PHP_CodeSniffer?

No. Those tools parse your code into a syntax tree, read your project config, and see the whole file set. This page matches patterns on masked lines with no parser and no project awareness. It covers the formatting layer that shows up in a diff, which is most of what a style guide argues about.

A semicolon finding looks wrong. What happened?

The semicolon check decides where a statement ends from the last character on the line plus a keyword exception list, since no parser runs here. Unusual formatting can trip it. Lines sitting inside an unclosed bracket are already skipped, which removes the common case.

Will Fix whitespace break my code?

It rewrites indentation to the guide character and width while keeping each line at its nesting level, strips trailing whitespace, collapses blank line runs, and adds a final newline. Nothing else. Two cases to watch: a continuation line you aligned by hand under a bracket gets pulled to the nearest whole level, and in a Python file already mixing tabs and spaces the rewrite changes which lines sit in which block. Clear the mixed indentation errors by hand first.

Why does a comment mentioning var not get flagged?

Comments are blanked and string bodies are replaced with filler before any rule runs, and the scanner carries block comment and triple quoted string state across lines. Rule words inside comments, docstrings, and string literals stay invisible to the checker.

The file came back clean. Is the code good?

It means no implemented rule matched. Naming that reads badly, a function doing four jobs, dead branches, and a stale comment all pass a formatting checker without a mark. Treat a clean result as one box ticked before a human reads the file.

Can I set my own column limit or indent width?

Not directly. Settings come from the guide presets so that every finding names a published document you can point at in review. Pick the preset closest to your house style, and read the guide note under the controls to see exactly what it enforces.