Free online text tool

Bracket and Tag Counter

Bracket and Tag Counter counts the opening and closing braces { }, parentheses ( ), square brackets [ ] and tags < > in your text or code. The counts update as you type, and a balance table shows which pairs are missing a closing or opening symbol. It is free and runs in your browser.

Brackets, Braces, Parentheses and Tags Counter

0Open Braces {
0Closing Braces }
0Open Parentheses (
0Closing Parentheses )
0Open Brackets [
0Closing Brackets ]
0Open Tags <
0Closing Tags >

Balance check

PairOpeningClosingStatus

Bracket and Tag Counter Example

Text

if (x > 1) { ↵ items = [1, 2, 3]; ↵ print((a + b) ↵ }

Opening / closing

Braces {}: 1 / 1 · Parentheses (): 3 / 2 · Brackets []: 1 / 1 · Tags <>: 0 / 1

Bookmark: press Ctrl+D (Windows) or Cmd+D (Mac) to save this tool.

Suggest a New ToolProvide Feedback on This Tool

What is a bracket and tag counter?

A bracket and tag counter counts the opening and closing symbols of paired characters in your text: curly braces { }, parentheses ( ), square brackets [ ] and angle brackets < >, which are used for tags.

Every opening symbol needs a matching closing one. When the counts do not match, something is missing, which is a common cause of errors in code, JSON, spreadsheet formulas and math expressions.

The tool counts symbols only. It does not read the code, so symbols in strings, comments and operators such as => or <= are counted too. For full checking use a linter or your editor's bracket matching.

Bracket and tag count examples

Each cell shows the number of opening symbols, then the number of closing symbols.

Text{ }( )[ ]< >
function add(a, b) { return [a, b]; }1 / 11 / 11 / 10 / 0
<div><p>Hello</p></div>0 / 00 / 00 / 04 / 4
if (x > 1) {1 / 01 / 10 / 00 / 1
((a + b)0 / 02 / 10 / 00 / 0

How to count brackets, braces, parentheses and tags

  1. 1
    Enter your text or code
    Paste or type your text into the box, or import a text file.
  2. 2
    Read the eight counts
    Opening and closing braces, parentheses, brackets and tags update as you type.
  3. 3
    Check the balance table
    See which pairs are balanced and which have extra opening or closing symbols.
  4. 4
    Copy the results
    Click Copy Results to copy the counts, or Clear to start again.

When to use a bracket counter

Good for

Finding a missing closing brace or parenthesis in code, checking JSON and formulas, comparing the number of < and > in an HTML snippet and checking math expressions.

Check first

Symbols in strings, comments and operators such as => are counted too, and different kinds are not checked for correct nesting. Use a linter for a full check.

Other tools

For the total count use Character Counter. To count the characters in each line use Count Each Line. To count words use Word Counter.

Bracket and tag counter FAQ

What does the Bracket and Tag Counter count?

It counts the opening and closing symbols of four pairs: curly braces { }, parentheses ( ), square brackets [ ] and angle brackets < >, which are used for tags. Each symbol is counted separately, so you get eight counts.

What is the difference between braces, parentheses and brackets?

Curly braces are { }, parentheses are ( ) and square brackets are [ ]. Angle brackets are < >, which are used for HTML and XML tags. In some countries the names are used differently, so this page names each symbol next to its count.

How are tags counted?

Open Tags counts every < and Closing Tags counts every >. A tag such as <div> adds one to each, and a closing tag such as </div> adds one to each as well. The tool counts the symbols, not the tag names.

Why does a balanced count matter?

Every opening symbol needs a closing one. A missing closing brace, bracket or parenthesis is a common cause of errors in code, JSON, formulas and math expressions. Comparing the counts is a quick first check.

Does the tool check the order and nesting?

It checks one thing beyond the totals: if a closing symbol appears before any opening symbol of the same kind, it says so and gives the line number. It does not check that different kinds are nested correctly, for example ( [ ) ].

Are symbols inside strings and comments counted?

Yes. The tool counts every symbol in the text, including those in strings, comments and operators such as =>, -> and <=. This can make the counts differ from what a compiler sees.

How do I find the missing bracket?

The balance table shows which kind is unbalanced and by how much. Then use the bracket matching in your code editor, or paste smaller parts of the code to find where the counts stop matching.

Can I use it to check HTML?

You can use it to compare the number of < and > symbols. It does not check tag names or whether each tag is closed, so use an HTML validator for that.

Is this tool free and is my text private?

Yes. It is free, needs no account and runs in your browser, so your text is not uploaded to a server. Still, avoid pasting passwords or other secrets into any web page.

Looking for more text tools?

Browse Counter Tools

Last updated: 25 October 2026