String Unigram Generator

Breaks text into its individual characters (unigrams), one per line, the simplest building block for character-frequency analysis or n-gram based text processing. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-22

Overview

Introduction

Character-level frequency analysis, cipher-breaking exercises, and n-gram language models all start from a list of individual characters.

This tool produces that list directly.

What Is String Unigram Generator?

A unigram generator that lists every character in the input on its own line, in original order.

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 String Unigram Generator Works

The input is spread into an array of Unicode code points and each one is printed on its own line.

The transformation happens synchronously in JavaScript the moment you type, with no network round trip involved.

When To Use String Unigram Generator

Use it as a first step toward character-frequency analysis, or to visually inspect every character in a string one at a time.

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.

Features

Advantages

  • Operates on Unicode code points, so multi-byte characters aren't split incorrectly.
  • Simple, direct output ready for further line-based processing like sorting or counting.
  • Produces exactly one line per code point, so the output's line count is the character count with no separate measurement needed.

Limitations

  • No filtering or deduplication; every character, including spaces and punctuation, appears.
  • Emits the characters in their original order without tallying them, so a frequency count still needs a separate sorting or counting step.

Examples

Breaking down a word

Input

hello

Output

h
e
l
l
o

Each character appears on its own line, in original order, including the repeated 'l'.

Best Practices & Notes

Best Practices

  • Pair with Sort Strings to group identical characters together for a quick frequency scan by eye.
  • Normalize the case first when counting letter frequency, otherwise 'A' and 'a' are tallied as two different characters.
  • Strip whitespace beforehand if only visible characters matter, since every space and newline occupies a line of its own.

Developer Notes

Splitting uses the spread operator ([...input]) rather than input.split(""), so multi-byte Unicode characters like emoji are kept as single unigrams instead of being split into broken surrogate-pair halves.

String Unigram Generator Use Cases

  • Preparing input for character-frequency analysis
  • Building a character-level n-gram model
  • Visually inspecting every character in a string

Common Mistakes

  • Expecting spaces or punctuation to be filtered out automatically.
  • Counting the output lines to get a word count, when what it actually reports is the character count.

Tips

  • Combine with Sort Strings and manual scanning for a quick, informal frequency check.
  • An emoji occupies a single line rather than two, which is a quick way to confirm it is one code point rather than a composed sequence.

References

Frequently Asked Questions