Skip to tool

SQL Character frequencies Online

Count character/code point frequencies.

The output updates as you type. The tool processes input in your browser.

Worked example

The result counts occurrences of each Unicode code point. A grapheme may span several entries. Use PostgreSQL’s function reference to adapt the input to SQL syntax.

Sample input
banana
Sample output
[
  {
    "codepoint": 97,
    "char": "a",
    "count": 3
  },
  {
    "codepoint": 98,
    "char": "b",
    "count": 1
  },
  {
    "codepoint": 110,
    "char": "n",
    "count": 2
  }
]

Using this operation in SQL

The interactive result uses JavaScript. Check the database dialect. PostgreSQL text functions use SQL-style one-based positions and LIKE uses its own pattern syntax.

SQL reference