How word clouds work, and when they mislead

How a word cloud counts words, why common words are dropped, how word size is set from counts, and when a plain table or bar chart tells the story better.

Open the Word cloud maker Free, in your browser, nothing uploaded.

A word cloud turns text into a picture where the most used words are the biggest: a quick way to see what survey answers, reviews or a speech keep coming back to. But the picture hides choices: which words were dropped, how size was worked out and which words did not fit. This article explains those choices so you can read a cloud with care. To get exact totals first, run the text through the word counter; to strip stray symbols and line breaks from pasted text, use the text cleaner; and to judge how easy the text is to read, try the readability checker.

What it is

A word cloud is built in three steps.

1. Split and count. The text is turned to lower case and cut into words: runs of letters and digits, keeping inner apostrophes and hyphens, so “don’t” and “wi-fi” stay whole. Plain numbers under three digits are dropped. Each word’s count is its frequency.

2. Drop stop words. In any English text, “the”, “and”, “of” and “is” are the most frequent words, and they say nothing about the topic. These are called stop words. The maker drops about 200 of them from a built-in list, plus any you add yourself.

3. Size and place. The most frequent word gets the biggest font and the least frequent gets the smallest. In between, size follows a square-root curve:

size = smallest + (biggest − smallest) × √((count − lowest count) ÷ (highest count − lowest count))

The square root stops one very common word from shrinking everything else into dust. Words are then placed biggest first on a spiral that winds out from the centre. A word is kept at the first spot where its box does not overlap another word and stays inside the shape. If no spot is found after shrinking it a few times, it is dropped, and the page says how many were.

Because of step 3, size is a ranking aid, not a measurement. A word used 4 times is not drawn at twice the size of one used 2 times, and long words take up more space than short ones with the same count. The table under the picture is where the real numbers are.

How to use it

  1. Paste your text into Your text, or choose Open a TXT file.
  2. Leave Leave out common words ticked for normal text; add names or filler you want gone in Also leave out these words.
  3. Set Skip words used fewer than to 2 or 3 for long texts, so one-off words do not clutter the picture.
  4. Choose Shape, Colours and Biggest word (px); tick Turn some words sideways to fit more in.
  5. Press Shuffle layout until you like the arrangement.
  6. Download the PNG or SVG, and the counts (CSV) if you want the numbers in a spreadsheet.

A worked example

A café collects seven short comments:

Great coffee and friendly staff. The coffee was hot and the cake was fresh. Staff were slow at lunch but friendly. Love the cake! Coffee was too bitter this time. Friendly staff, great music, slow Wi-Fi. Best coffee in town.

That is 40 words. With common words left out, 26 words remain, made of 16 different words. The top of the table reads: coffee 4, friendly 3, staff 3, cake 2, great 2, slow 2, and ten words used once (best, bitter, fresh, hot, love, lunch, music, time, town, wi-fi).

Set the minimum to 2 and exactly those six words stay. With the biggest word at 90 px and the smallest at 14 px, “coffee” is drawn at 90 px, “friendly” and “staff” at about 76 px, “cake”, “great” and “slow” at about 58 px, and every one-off word at 14 px.

Untick Leave out common words and “the” and “was” join the top with 3 each, tied with “friendly” and “staff”. That is why the stop list matters. Notice too that “slow” (twice) is one of the six biggest words: the café should read the comments around it, since a cloud cannot tell praise from complaint.

Checked with the tools

The counts came from the maker’s own code (src/lib/docs/wordcloud.ts) run in Node: tokens() found 40 words, countWords() gave the table above with and without stop words and with a minimum of 2, and fontSize() gave 14.0, 57.9, 76.1 and 90.0 px for counts of 1 to 4. The chart plots fontSize() for counts from 1 to 20.

Font size against word count (lowest 1, highest 20)Font size against word count (lowest 1, highest 20)0204060801005101520Times the word is usedFont size (px)Word cloud maker (square root)Straight line, for comparisonfibub.com
Font size from the maker's fontSize() rule at its default sizes (14 to 90 px) when the least used word appears once and the most used 20 times. The dashed straight line is shown only for comparison.

The curve rises fast at first and then flattens. A word used twice already gets more than a third of the biggest size when the lowest count is 1, so the gap between “used once” and “used twice” looks much bigger than the gap between 15 and 20 uses.

Where it is used

  • Teaching. A cloud of a poem or a chapter starts a class talking about its themes.
  • Surveys and feedback. A first look at open answers before reading them properly.
  • Writing. A cloud of your own essay shows words you lean on too often.

Common mistakes

  • Treating size as a measure. Quote the counts from the table, not the picture.
  • Missing negations. “not friendly” adds a count to “friendly”. Read the text behind any big word.
  • Leaving names in. A speaker’s name in every line of a transcript will dominate. Add it to Also leave out.
  • Counting plurals as different ideas. “tool” and “tools” are separate entries. Add them up yourself from the table, or edit the text first.

Questions people ask

When should I use a bar chart instead? When the exact numbers matter or you are comparing groups. A sorted bar chart of the top 10 words is easier to read accurately; a cloud is better at grabbing attention.

Why does the layout change when I shuffle? The spiral starts at a random angle each time, so words land in different places. The counts and sizes stay the same.

Sources

  • Word counts are fibub's own: text is split into words, common English words are dropped from a built-in list, and sizes grow with the square root of the count. The layout is a spiral placement written for fibub. No outside rules or figures.

If you are an author or publisher and want a credit or a passage changed or removed, tell us and we will act quickly.

Tools in this article

Read next