Syllable Counter
Melodies are built on syllables, not words. Paste your lyrics, and we'll count every line, flag the lines that will fight your melody, and tell you whether the whole verse fits a 4/4 groove at a normal tempo.
Last updated: November 2026 · Reviewed by the SongSpark editorial team最后更新:2026 年 11 月 · 由 SongSpark 编辑团队 审校
Why syllable counts decide whether a lyric is singable为什么音节数决定一句词能不能唱
A melody is a row of rhythmic slots. Two bars of 4/4 at a steady tempo hold a fixed number of notes, and every syllable you sing takes one of them. That is why a line of eighteen syllables and a line of seven are not interchangeable over the same music: one forces you to rush, the other leaves a hole where a note should be. Counting is the cheapest way to catch that mismatch before you sit down with a guitar, and it can be done on the words alone, with no melody existing yet. This page measures one property — how many syllable-like units each line contains — and deliberately says nothing about stress, rhyme, imagery, or whether the line is worth singing at all.
旋律是一排节奏槽。稳定的速度下,两小节 4/4 能容纳的音符数是固定的,而你唱的每一个音节都要占掉其中一个音符。这就是为什么「十八个音节的一行」和「七个音节的一行」没法配同一段音乐:前者逼你抢拍,后者留下一个本该有音符的空洞。在坐下来弹琴之前,数音节是发现这种错配最省力的办法,而且只需要看文字,旋律不必先存在。这一页只测量一件事——每行有多少个「类似音节」的单位——并且刻意不提重音、押韵、意象,也不评价这句词值不值得唱。
The verdict is relative rather than absolute. Every line is compared to the median line of the text you pasted, so what the table really says is "this line is unlike the rest of your draft", not "this line is wrong". A verse written entirely in ten-syllable lines will show every line as fitting even if your melody only has room for six. Use it to find the line that ran away, then decide for yourself whether the rest of the draft is the thing that should change.
它的判断是相对的,不是绝对的。每一行都在和你粘贴文本的中位数行比较,所以表格真正说的是「这一行和你草稿里的其他行不一样」,而不是「这一行错了」。如果整段主歌都写成十个音节,那么即使你的旋律只装得下六个,每行也会显示「合适」。用它找出跑掉的那一行,再由你自己判断:该改的会不会其实是草稿的其他部分。
How to use the Syllable Counter音节计数器怎么用
- Paste one lyric line per row. The counter reads your line breaks, so keep the breaks you actually intend: a paragraph wrapped by your editor arrives as one very long line and will be counted as one.
- Press Try an example once if you want to see the output format before using your own words. It loads a six-line verse and the table fills in immediately.
- Read the four summary numbers: how many lines, how many syllables in total, how many words, and an estimate of reading or singing time.
- Work down the Syllables column and find the median by eye — the count shared by most of your lines. That number, not any textbook rule, is what the Status column measures each line against.
- Rewrite only the flagged lines. Three moves fix most of them: cut two or three words, split the line into two shorter ones, or move its last image onto the following line.
- Paste the new version back into your draft file yourself. This page keeps only your most recent input in local storage and holds no history, so nothing older can be recovered after you overwrite the box.
- 每行粘贴一句歌词。计数器读的是你输入的换行,所以请保留你真正想要的断行:被编辑器自动折行的整段文字会作为一整条很长的行进来,并被当成一行计数。
- 想先看输出格式,就点一次「试个示例」。它会载入一段六行的主歌,表格立刻填满。
- 先读四个汇总数字:行数、音节总数、词数,以及一个朗读或演唱耗时的估算。
- 沿着「音节数」这一列往下看,用眼睛找出中位数——你大多数行共有的那个数字。状态列比的正是这个数,而不是任何教科书规则。
- 只改被标记的行。三招能解决大多数情况:删掉两三个词、把这一行拆成两行更短的、或把句末那个意象挪到下一行。
- 改完请你自己把新版本粘回草稿文件。这一页只在本机保存你最近一次输入,不留历史,一旦覆盖输入框,旧版本就找不回来了。
How it works under the hood底层是怎么算的
The input is split with raw.split(/\n+/), so any run of newlines counts as one break; each line is then trimmed and blank lines are dropped. Extra spaces inside a line are collapsed by the word-count split, so they never inflate a total, and nothing is re-flowed or re-punctuated. The table rows keep your original order — there is no sorting — so line six of the table is line six of your draft.
输入先用 raw.split(/\n+/) 切开,所以连续多个换行只算一次断行;随后每行去掉首尾空格,空行被丢弃。行内多余的空格在统计词数时会被合并,因此不会让总数虚高;文本也不会被重新折行或改标点。表格行保持你原来的顺序——没有排序——所以表格第六条就是草稿的第六条。
Counting is delegated to lyricEngine.countSyl(), which decides per line rather than per interface. If the line contains any Han character it counts those characters and ignores the rest; otherwise it lowercases the line, matches /[a-z']+/g (the apostrophe is allowed, so "don't" stays one word) and sums syllablesEN() over those matches. A mixed line is treated as Chinese, so English lines typed with the interface in Chinese now keep their syllable numbers instead of being scored by character count.
计数交给 lyricEngine.countSyl(),它按行判断,而不是按界面语言。只要这一行含有汉字,就数汉字、忽略其余字符;否则先把整行转小写,用 /[a-z']+/g 取词(允许撇号,所以 "don't" 算一个词),再对每个词调用 syllablesEN() 累加。中英混排的行按中文处理,因此中文界面下输入的英文行现在仍按音节计分,不再变成字符数。
Inside syllablesEN() the word is first checked against a small exception table of about ninety common words — created, every, beautiful, poem, fire, people, together, another, remember, forever and similar. If it is listed, the table's number is returned immediately, because those words break every vowel-group rule. Otherwise four mechanical steps run: strip every character that is not a–z; delete a trailing ed, a silent e after a consonant, or es after a consonant, using /(?:[^laeiouy]es|ed|[^laeiouy]e)$/; remove a leading y; then count vowel groups with /[aeiouy]{1,2}/g, returning 1 when nothing matches. The exception table is finite, so uncommon words still misfire, and a hyphen is not in the allowed character class: "won-der-ful" breaks into three words and comes out as 3.
syllablesEN() 先把整词查一张约九十条常见词的例外表——created、every、beautiful、poem、fire、people、together、another、remember、forever 之类。命中就直接返回表里的数字,因为这些词会破坏所有元音组规则。没命中才走四个机械步骤:先剥离所有非 a–z 的字符;再用 /(?:[^laeiouy]es|ed|[^laeiouy]e)$/ 删掉结尾的 ed、辅音后的不发音 e、或辅音后的 es;然后去掉词首的 y;最后用 /[aeiouy]{1,2}/g 数元音组,一个都没匹配上就返回 1。例外表终究有限,生僻词仍会算错;又因为连字符不在允许的字符集里,"won-der-ful" 会被拆成三个词分别计数,结果是 3。
Around the counts sit three plain sums. Total syllables is the sum of every line. The word figure comes from text.split(/\s+/) per line, so a lone dash or ellipsis standing as a token still counts as a word. The time estimate is Math.ceil(total / 180): a flat assumption of 180 syllables per minute, which is a reading pace and has nothing to do with the tempo of your actual song. Sixty syllables therefore show as "1 min" whether the track is a ballad or a punk chorus.
计数之外还有三个朴素求和。音节总数是每行的累加。词数按每行 text.split(/\s+/) 得到,所以单独一个破折号或省略号也算一个词。耗时估算是 Math.ceil(total / 180):固定假设每分钟 180 个音节,这是一个朗读速度,和你这首歌真正的速度毫无关系。因此六十个音节永远显示「1 分钟」,无论它是抒情慢歌还是朋克副歌。
The Status column is where the judgement happens. All counts are sorted ascending and the lower middle value is taken with sorted[Math.floor((n - 1) / 2)]; with an even number of lines that picks the lower of the two middle values, so two lines of 8 and 9 give a median of 8. Each line's deviation is its count minus that median, and a line is flagged only when the deviation is larger than two in either direction, printed as "off by +6" or "off by -6". The threshold is fixed; it is not scaled to line length or to how many lines you pasted.
判断发生在「状态」这一列。所有计数升序排列后,用 sorted[Math.floor((n - 1) / 2)] 取偏低的中间值;行数为偶数时取两个中间值里较小的那个,所以 8 和 9 两行得到的中位数是 8。每行的偏差是本行计数减去这个中位数,只有当偏差超过 2 时才会标记,显示为 "off by +6" 或 "off by -6"。这个阈值是固定的,不会按行长缩放,也不随粘贴行数变化。
Everything is recomputed on every keystroke — there is no button and no debounce — and an empty box clears both the summary and the table. There is no rhyme check, no stress or meter analysis, no target line length you can set, no comparison against a recorded melody, and no English dictionary; lines are never corrected, only measured. The counting happens in this tab, so nothing is sent anywhere, but the last input is written to local storage so the box is not empty when you return.
A worked example一个实例
Paste these six lines. They are an ordinary late-night driving verse, and they were written without counting anything first, which is exactly the situation the tool exists for. The numbers below are the same in either interface, because each line is judged by its own script:
粘贴下面这六行。这是一段普通的深夜开车主歌,写的时候完全没有数过音节——这正是这个工具存在的场景。下面的数字在两种界面语言下都一样,因为每一行是按它自己用什么文字来判断的:
City lights are calling me home Radio hums a song I know Every street remembers your name I drive the long way back again The engine keeps its steady beat And every signal turns to gold before the morning finds me on the road
City lights are calling me home Radio hums a song I know Every street remembers your name I drive the long way back again The engine keeps its steady beat And every signal turns to gold before the morning finds me on the road
The stats row reports 6 lines, 57 syllables, 44 words and 1 min read/sing, and the table comes back in exactly this shape:
统计条显示 6 行、57 个音节、44 个词和 1 分钟读/唱,表格返回的正是这个样子:
Line Syllables Status City lights are calling me home 8 fits Radio hums a song I know 7 fits Every street remembers your name 8 fits I drive the long way back again 8 fits The engine keeps its steady beat 8 fits And every signal turns to gold before the morning finds me on the road 18 off by +10
Line Syllables Status City lights are calling me home 8 fits Radio hums a song I know 7 fits Every street remembers your name 8 fits I drive the long way back again 8 fits The engine keeps its steady beat 8 fits And every signal turns to gold before the morning finds me on the road 18 off by +10
The six counts are 8, 7, 8, 8, 8 and 18. Sorted, they become 7, 8, 8, 8, 8, 18, and sorted[Math.floor((6 - 1) / 2)] is index 2 — the median is 8, not some ideal lyric length. That gives deviations of 0, −1, 0, 0, 0 and +10, so five lines pass and only the runaway line is flagged, exactly as the rule predicts. Note that the 7-syllable line also passes: it is one beat short of the median, inside the two-syllable window, and the table will not tell you that it is short — you have to hear that when both lines share a melody.
六个计数是 8、7、8、8、8、18。排序后是 7、8、8、8、8、18,sorted[Math.floor((6 - 1) / 2)] 取下标 2——中位数是 8,而不是某个理想歌词长度。于是偏差分别是 0、−1、0、0、0、+10,五行通过,只有跑掉的那一行被标记,和规则完全吻合。注意那个 7 音节的行也通过了:它比中位数少一拍,落在两个音节的窗口内,表格不会告诉你它偏短——这需要你在两行共用一个旋律时用耳朵听出来。
To fix the last line, split it instead of trimming it. "And every signal turns to gold" measures 8 and "before the morning finds me on the road" measures 10, so the paste becomes seven lines of 8, 7, 8, 8, 8, 8 and 10; the median is still 8 and every line now sits within the window, which is why the flag disappears after a split that deleted no words at all.
要修那一行,请拆开而不是删减。「And every signal turns to gold」是 8 个音节,「before the morning finds me on the road」是 10 个,于是粘贴内容变成 7 行:8、7、8、8、8、8、10;中位数仍是 8,每行都落在窗口内——这就是为什么一次没删任何词的拆分之后,标记就消失了。
Songwriter's tips写歌小贴士
- Count in blocks of four. Two bars of 4/4 takes about eight syllables at a comfortable pace, so a pop verse usually settles around 8 or 10 and a sparse ballad around 6 or 7.
- Pick a target line and rewrite towards it. Take the count of the line you like best and treat it as the number the rest of the verse has to reach, instead of chasing the median of a draft that may be uneven everywhere.
- Split before you trim. An 18-syllable line is often two good lines wearing one line break; deleting words to hit a number is the more destructive move.
- Count the stresses, not just the syllables. Two eight-syllable lines can still fail together if the stressed beats land in different places, and the counter cannot see that.
- Keep the original beside the rewrite. The tool holds no history, so a line you shorten without saving is gone once you paste over it.
- Re-count after switching the interface language. The counter now decides per line: a line containing Chinese characters is counted in characters, a line in Latin letters is counted in syllables, so English lines keep their numbers even in the Chinese interface.
- 以四拍为单位数。舒适的速度下,两小节 4/4 大约容纳八个音节,所以流行主歌通常落在 8 或 10,稀疏的抒情歌落在 6 或 7。
- 挑一个目标行,朝它改写。取你最喜欢那行的音节数,当作整段主歌要抵达的数字,而不是去追一份可能处处不均的草稿的中位数。
- 先拆,再删。18 个音节的一行,常常是两句好词共用一个断行;为了凑数字去删词,是更具破坏性的做法。
- 数重音,不只数音节。两行都是八个音节,如果重音落的位置不同,合在一起照样会翻车,而计数器看不见这一点。
- 把原句留在旁边。工具不留历史,你缩短过又没另存的那一行,一旦粘贴覆盖就找不回来了。
- 切换界面语言后重新数。计数器现在按行判断:含汉字的行按汉字计数,只含拉丁字母的行按音节计数,因此中文界面下的英文行数字不会跳变。
FAQ常见问题
Is the syllable counter free to use?这个音节计数器免费吗?
Are my lyrics uploaded when I paste them?粘贴的歌词会被上传吗?
How accurate is the count? Some words still look wrong.计数准不准?有些词还是算错。
A line says "fits" but it still fights my melody. What does the status actually mean?某行显示「合适」,可它唱起来还是和旋律打架,这个状态到底代表什么?
Does it work for Chinese or other languages?中文或其他语言也能用吗?
Where to go next接下来去哪
- Repetition Checker — once the lines are even, find out how often you lean on the same word.
- Lyric Genie — generate a verse and compare its syllable counts with the target you just settled on.
- Melody Writing for Beginners — how to map counted syllables onto notes and add a contour.
- How to Find the Perfect Rhyme — fix the rhyme after the line length already fits.