A syllable is built around a single vowel sound, so counting the vowel groups in a word gives its syllable count. Swedish spelling is highly phonetic and uses nine vowels — a, e, i, o, u, y, and the extra letters å, ä, ö — which makes this vowel-nucleus method reliable for most text.
How it works
The counter scans each word and counts runs of consecutive vowels, treating each run as one nucleus:
vowels = a e i o u y å ä ö (case-insensitive)
syllables in word = number of maximal vowel runs
total = sum over all words
Because adjacent vowels usually spell a single sound in Swedish (as in nej or hej), a vowel cluster is counted once rather than once per letter.
Example and tips
Stockholm has the vowel runs o and o, giving two syllables; nationalstad
contains five vowel nuclei and so five syllables. The method shines on Swedish’s
long compound words, where each component contributes its own vowels. For poetry
or song metrics, double-check rare loanwords with silent vowels, as the heuristic
may be off by one in those cases.