Overview
Introduction
Figuring out which punctuation or special characters appear in a block of text, and how often, is useful when cleaning data or auditing formatting but tedious to count by eye.
This tool extracts and tallies every symbol character automatically.
What Is Symbol Sorter?
A symbol extractor that scans the text for every character that isn't a letter, digit, or whitespace, counts occurrences of each distinct symbol, and lists them sorted alphabetically as 'symbol: count' lines.
It runs entirely client-side as part of this site's String Tools collection, so nothing you paste is ever uploaded to a server.
How Symbol Sorter Works
The input is scanned with a regular expression that matches any character outside the letter, digit, and whitespace ranges; matches are tallied in a frequency map, and the distinct symbols are sorted alphabetically before being formatted one per line.
The transformation happens synchronously in JavaScript the moment you type, with no network round trip involved.
When To Use Symbol Sorter
Use it to audit which punctuation or special characters appear in a dataset before writing a parser, or to spot unexpected characters in pasted text.
It's a fast way to get the answer without opening a code editor, a REPL, or writing a one-off script just to check.
Often used alongside Text Sorter and Letter Sorter.
Features
Advantages
- Gives both which symbols appear and how often in a single scan.
- Sorted output makes it easy to compare symbol sets between two pieces of text.
- Reports each distinct symbol once alongside its total, so text peppered with the same character produces a single line rather than hundreds.
Limitations
- Does not report the position of each symbol occurrence, only the total count.
- Sorts by the symbol's code point, so visually related characters such as the various dash and quote forms end up scattered rather than grouped together.
Examples
Best Practices & Notes
Best Practices
- Use this before writing a regex-based parser to confirm exactly which special characters you need to account for.
- Run it over a representative sample rather than a single line, since rare symbols are exactly the ones a parser trips over later.
- Compare the output between two documents to spot characters present in one but missing from the other.
Developer Notes
Symbols are matched with `/[^a-zA-Z0-9\s]/g`, tallied in a `Map<string, number>`, then the entries are sorted with `(a, b) => a[0].localeCompare(b[0])` and formatted as `${symbol}: ${count}` lines.
Symbol Sorter Use Cases
- Auditing punctuation and special characters before writing a parser
- Spotting unexpected characters in pasted or imported text
- Comparing the symbol makeup of two texts
Common Mistakes
- Expecting underscores or accented letters to count as symbols; only non-alphanumeric, non-whitespace characters are extracted.
- Assuming a low count means a symbol is unimportant; one stray character is often precisely what breaks a parser.
Tips
- Run this before Find and Replace to see exactly which symbol characters are present before deciding what to replace.
- Typographic quotes and dashes appear here as separate entries from their ASCII equivalents, which makes them easy to find and normalize.