Code

Bracket and Quote Balance Checker

Finds the unclosed bracket, quote or comment and reports where it was opened.

Loading the tool…

Processing happens locally in your browser. What you paste or load is processed by this page and is not uploaded to a server. Nothing is stored unless you use a control that says it stores something, and you can clear anything this site has kept from the privacy page.

How to use this tool

  1. Paste the file that will not parse.
  2. Select Check.
  3. Go to the line in the first finding — the later ones are usually consequences of it.

What bracket checker does

A compiler reports an unclosed brace at the end of the file, which is the one place it certainly is not. This reports where the unclosed thing was opened, with a line and column, which is where you actually have to go. Unterminated strings and unterminated block comments are found the same way, and they matter more, because both swallow the code that follows them.

Brackets inside strings and comments are ignored, so an emoticon in a message and a lone brace in a doc comment do not produce false findings. When several problems are listed, the first is usually the real one: everything after an unclosed bracket tends to be a consequence of it rather than a separate mistake.

Frequently asked questions

A compiler notices the problem at the end of the file, because that is where the count fails to add up, and reports it there. This reports the line and column where the unclosed thing was opened, which is where the mistake actually is.

No. Strings and comments are excluded, so a smiley in a message or a lone brace in a doc comment produces no finding. That exclusion is the whole reason a naive counter is useless on real code.

The first. Everything after an unclosed bracket or an unterminated string tends to be a consequence of it: the parser is reading the rest of the file in the wrong state. Fix the first and re-run before looking at the others.