Text Counter

Count characters, words, bytes, and more in real time.

0
Total Characters
0
Chars (no space)
0
Words
0
Lines
0
Bytes
0
Sentences

πŸ“– How to Use

1
Enter Text

Type or paste the text you want to analyze.

2
View Live Statistics

All counts update in real time as you type: characters, words, lines, bytes, and sentences.

3
Copy or Clear

Click πŸ“‹ Copy Text to copy the input, or πŸ—‘οΈ Clear to reset.

πŸ’‘ Tip: Useful for social media posts (Twitter 280 chars, Instagram 2,200 chars), essays, and cover letters. Korean characters count as 3 bytes.

About the Text Counter

The Text Counter measures a string across four axes — characters, words, lines, and bytes — updating in real time as you type. Each axis answers a different question, which matters whenever limits are involved: a tweet is bounded by character count, an essay by word count, a source file by line count, and a network payload by byte count.

How it works

The character count uses the JavaScript String.prototype.length property, which returns the number of UTF-16 code units — not the number of visible symbols. Most text fits in a single code unit (one per ASCII letter, one per common CJK ideograph), but any code point above U+FFFF is encoded as a surrogate pair of two code units. That is why an emoji such as πŸ˜€ reports .length === 2 even though a reader perceives one glyph. To count what humans actually see — grapheme clusters, which also cover Hangul jamo combinations and emoji joined with a Zero-Width Joiner (ZWJ) — you need Intl.Segmenter with the grapheme granularity.

Words are split on the regular expression /\s+/ and the non-empty segments are counted. Lines are split on \n. Bytes come from TextEncoder, which encodes the string as UTF-8: ASCII takes 1 byte, Latin-1 letters take 2, Hangul syllables take 3, and most emoji take 4. Everything runs locally in the browser.

Common use cases

  • Checking length against a tweet limit of 280 characters or a meta description of ~155
  • Counting words for essays, abstracts, and cover letters with a fixed quota
  • Measuring the UTF-8 byte size of a payload before sending it over a network
  • Estimating reading time at roughly 200–250 words per minute
  • Verifying line counts when a style guide caps file length

Worked example

Take the string Hi μ•ˆλ…• πŸ˜€ (a space, two ASCII letters, a space, two Hangul syllables, a space, and one emoji). The counts come out as follows:

Characters (.length):     8   // H,i,space,μ•ˆ,λ…•,space,surrogate-pair
Bytes (UTF-8):           13   // 2 + 1 + 6 + 1 + 4
Words (\s+ split):        3   // "Hi", "μ•ˆλ…•", "πŸ˜€"
Lines (\n split):         1
Graphemes (Segmenter):    6   // what the user sees

Notice the gap between .length (8) and graphemes (6): the surrogate pair collapses into one perceived character, so a strict .length check misreports emoji text.

Frequently asked questions

Why does an emoji count as two characters?

JavaScript strings are stored as UTF-16, and the .length property counts code units, not visible symbols. Characters outside the Basic Multilingual Plane (such as emoji) are encoded as a surrogate pair of two code units, so .length reports 2. A grapheme counter using Intl.Segmenter reports 1 because it counts what a user perceives as a single character.

How are words counted?

Words are counted by splitting the text on one or more whitespace characters (the regular expression /\s+/), then counting the non-empty segments. Punctuation attached to a word is not stripped, so hello, counts as one word.

What is the difference between characters and bytes?

Characters counts UTF-16 code units via string .length. Bytes counts the size of the UTF-8 encoding using TextEncoder. An ASCII letter is 1 byte, a Korean Hangul syllable is typically 3 bytes, and an emoji is usually 4 bytes.

How are lines counted?

Lines are counted by splitting the input on the newline character (\n). An empty input reports 0 lines, while a single line with no trailing newline reports 1.

Is my text uploaded to a server?

No. Every count is computed locally in your browser as you type. The text never leaves your device, so the tool is safe for drafts, messages, and sensitive content.

ν…μŠ€νŠΈ μΉ΄μš΄ν„°λž€?

ν…μŠ€νŠΈ μΉ΄μš΄ν„°λŠ” λ¬Έμžμ—΄μ˜ 크기λ₯Ό 문자, 단어, 쀄, λ°”μ΄νŠΈλΌλŠ” λ„€ κ°€μ§€ κΈ°μ€€μœΌλ‘œ μΈ‘μ •ν•˜λ©°, μž…λ ₯ν•  λ•Œλ§ˆλ‹€ μ‹€μ‹œκ°„μœΌλ‘œ κ°±μ‹ ν•©λ‹ˆλ‹€. 각 기쀀은 μ„œλ‘œ λ‹€λ₯Έ μ§ˆλ¬Έμ— λ‹΅ν•˜λ―€λ‘œ κΈ€μž 수 μ œν•œμ΄ κ±Έλ¦° μƒν™©μ—μ„œ μ˜λ―Έκ°€ μžˆμŠ΅λ‹ˆλ‹€. νŠΈμœ—μ€ 문자 수둜, μ—μ„Έμ΄λŠ” 단어 수둜, μ†ŒμŠ€ νŒŒμΌμ€ 쀄 수둜, λ„€νŠΈμ›Œν¬ νŽ˜μ΄λ‘œλ“œλŠ” λ°”μ΄νŠΈ 수둜 μ œν•œλ©λ‹ˆλ‹€. λ‚΄ 상황에 μ–΄λ–€ 기쀀이 ν•΄λ‹Ήν•˜λŠ”μ§€ μ•„λŠ” 것이 이 도ꡬ ν™œμš©μ˜ μ ˆλ°˜μž…λ‹ˆλ‹€.

μž‘λ™ 방식

문자 μˆ˜λŠ” JavaScript의 String.prototype.length 속성을 μ‚¬μš©ν•˜λ©°, 이것은 λ³΄μ΄λŠ” 기호의 κ°œμˆ˜κ°€ μ•„λ‹ˆλΌ UTF-16 μ½”λ“œ λ‹¨μœ„(code unit)의 개수λ₯Ό λ°˜ν™˜ν•©λ‹ˆλ‹€. λŒ€λΆ€λΆ„μ˜ ν…μŠ€νŠΈλŠ” μ½”λ“œ λ‹¨μœ„ ν•˜λ‚˜λ‘œ ν‘œν˜„λ©λ‹ˆλ‹€(ASCII κΈ€μž ν•˜λ‚˜λ‹Ή 1개, 일반적인 ν•œμž/ν•œκΈ€ 음절 ν•˜λ‚˜λ‹Ή 1개). ν•˜μ§€λ§Œ U+FFFFλ₯Ό λ„˜λŠ” μ½”λ“œ ν¬μΈνŠΈλŠ” μ„œλ‘œκ²Œμ΄νŠΈ 쌍(surrogate pair)μ΄λΌλŠ” 두 개의 μ½”λ“œ λ‹¨μœ„λ‘œ μΈμ½”λ”©λ©λ‹ˆλ‹€. κ·Έλž˜μ„œ πŸ˜€ 같은 이λͺ¨μ§€λŠ” μ½λŠ” μ‚¬λžŒμ΄ ν•œ κΈ€μžλ‘œ 보더라도 .length === 2둜 λ‚˜μ˜΅λ‹ˆλ‹€. μ‚¬λžŒμ΄ μ‹€μ œλ‘œ μΈμ‹ν•˜λŠ” λ‹¨μœ„μΈ κ·Έλž˜ν•Œ ν΄λŸ¬μŠ€ν„°(grapheme cluster) — ν•œκΈ€ 자λͺ¨ μ‘°ν•©μ΄λ‚˜ ZWJ(폭 μ—†λŠ” κ²°ν•©μž)둜 이어진 이λͺ¨μ§€κΉŒμ§€ 포함 — λ₯Ό μ„Έλ €λ©΄ grapheme λ‹¨μœ„μ˜ Intl.Segmenterλ₯Ό μ‚¬μš©ν•΄μ•Ό ν•©λ‹ˆλ‹€.

λ‹¨μ–΄λŠ” μ •κ·œμ‹ /\s+/(ν•˜λ‚˜ μ΄μƒμ˜ 곡백 문자)둜 λΆ„ν• ν•œ λ’€ 빈 μ„Έκ·Έλ¨ΌνŠΈλ₯Ό μ œμ™Έν•˜κ³  μ…‰λ‹ˆλ‹€. 쀄은 \n으둜 λΆ„ν• ν•©λ‹ˆλ‹€. λ°”μ΄νŠΈλŠ” λ¬Έμžμ—΄μ„ UTF-8둜 μΈμ½”λ”©ν•˜λŠ” TextEncoderμ—μ„œ κ°€μ Έμ˜΅λ‹ˆλ‹€. ASCIIλŠ” 1λ°”μ΄νŠΈ, 라틴-1 κΈ€μžλŠ” 2λ°”μ΄νŠΈ, ν•œκΈ€ μŒμ ˆμ€ 3λ°”μ΄νŠΈ, λŒ€λΆ€λΆ„μ˜ 이λͺ¨μ§€λŠ” 4λ°”μ΄νŠΈμž…λ‹ˆλ‹€. λ¬Έμž₯은 μ’…κ²° κ΅¬λ‘μ μœΌλ‘œ λΆ„ν• ν•©λ‹ˆλ‹€. λͺ¨λ“  계산은 λΈŒλΌμš°μ € μ•ˆμ—μ„œ 둜컬둜 μ΄λ£¨μ–΄μ§‘λ‹ˆλ‹€.

자주 μ“°λŠ” 경우

  • νŠΈμœ— 280자 μ œν•œμ΄λ‚˜ 메타 μ„€λͺ… μ•½ 155자 기쀀에 λ§žλŠ”μ§€ ν™•μΈν•˜κΈ°
  • μ •ν•΄μ§„ λΆ„λŸ‰μ˜ 에세이, 초둝, μžκΈ°μ†Œκ°œμ„œμ˜ 단어 수 μ„ΈκΈ°
  • λ„€νŠΈμ›Œν¬λ‘œ μ „μ†‘ν•˜κΈ° 전에 νŽ˜μ΄λ‘œλ“œμ˜ UTF-8 λ°”μ΄νŠΈ 크기 재기
  • λΆ„λ‹Ή μ•½ 200–250단어 κΈ°μ€€μœΌλ‘œ μ˜ˆμƒ 읽기 μ‹œκ°„ κ³„μ‚°ν•˜κΈ°
  • μŠ€νƒ€μΌ κ°€μ΄λ“œκ°€ 파일 길이λ₯Ό μ œν•œν•  λ•Œ 쀄 수 ν™•μΈν•˜κΈ°

μ‚¬μš© 예

Hi μ•ˆλ…• πŸ˜€λΌλŠ” λ¬Έμžμ—΄(곡백, ASCII 두 κΈ€μž, 곡백, ν•œκΈ€ 음절 두 개, 곡백, 이λͺ¨μ§€ ν•œ 개)을 생각해 λ΄…μ‹œλ‹€. κ²°κ³ΌλŠ” λ‹€μŒκ³Ό κ°™μŠ΅λ‹ˆλ‹€.

문자 수 (.length):     8   // H,i,곡백,μ•ˆ,λ…•,곡백,μ„œλ‘œκ²Œμ΄νŠΈ-쌍
λ°”μ΄νŠΈ (UTF-8):       13   // 2 + 1 + 6 + 1 + 4
단어 (\s+ λΆ„ν• ):       3   // "Hi", "μ•ˆλ…•", "πŸ˜€"
쀄 (\n λΆ„ν• ):          1
κ·Έλž˜ν•Œ (Segmenter):    6   // μ‚¬μš©μžκ°€ λ³΄λŠ” κΈ€μž 수

.length(8)와 κ·Έλž˜ν•Œ(6) μ‚¬μ΄μ˜ 차이λ₯Ό μ£Όλͺ©ν•˜μ„Έμš”. μ„œλ‘œκ²Œμ΄νŠΈ 쌍의 두 μ½”λ“œ λ‹¨μœ„κ°€ 인지상 ν•œ κΈ€μžλ‘œ 합쳐지기 λ•Œλ¬Έμ—, μ—„κ²©ν•œ .length κ²€μ‚¬λŠ” 이λͺ¨μ§€κ°€ ν¬ν•¨λœ ν…μŠ€νŠΈλ₯Ό 잘λͺ» μ…€ 수 μžˆμŠ΅λ‹ˆλ‹€.

자주 λ¬»λŠ” 질문

이λͺ¨μ§€κ°€ μ™œ 두 κΈ€μžλ‘œ μΉ΄μš΄νŠΈλ˜λ‚˜μš”?

JavaScript λ¬Έμžμ—΄μ€ UTF-16으둜 μ €μž₯되며 .length 속성은 λ³΄μ΄λŠ” κΈ°ν˜Έκ°€ μ•„λ‹ˆλΌ μ½”λ“œ λ‹¨μœ„ 수λ₯Ό μ…‰λ‹ˆλ‹€. κΈ°λ³Έ λ‹€κ΅­μ–΄ 평면(BMP) λ°–μ˜ 문자(이λͺ¨μ§€ λ“±)λŠ” 두 개의 μ½”λ“œ λ‹¨μœ„λ‘œ 이루어진 μ„œλ‘œκ²Œμ΄νŠΈ 쌍으둜 μΈμ½”λ”©λ˜λ―€λ‘œ .lengthκ°€ 2λ₯Ό λ°˜ν™˜ν•©λ‹ˆλ‹€. Intl.Segmenter 기반의 κ·Έλž˜ν•Œ μΉ΄μš΄ν„°λŠ” μ‚¬μš©μžκ°€ ν•œ κΈ€μžλ‘œ μΈμ‹ν•˜λŠ” λ‹¨μœ„λ₯Ό μ„Έλ―€λ‘œ 1을 λ°˜ν™˜ν•©λ‹ˆλ‹€.

λ‹¨μ–΄λŠ” μ–΄λ–»κ²Œ μ„Έλ‚˜μš”?

ν…μŠ€νŠΈλ₯Ό ν•˜λ‚˜ μ΄μƒμ˜ 곡백 문자(μ •κ·œμ‹ /\s+/)둜 λΆ„ν• ν•œ λ’€ 빈 μ„Έκ·Έλ¨ΌνŠΈλ₯Ό μ œμ™Έν•˜κ³  μ…‰λ‹ˆλ‹€. 단어에 뢙은 ꡬ두점은 μ œκ±°ν•˜μ§€ μ•ŠμœΌλ―€λ‘œ hello,λŠ” ν•œ λ‹¨μ–΄λ‘œ μΉ΄μš΄νŠΈλ©λ‹ˆλ‹€.

문자 μˆ˜μ™€ λ°”μ΄νŠΈ 수의 μ°¨μ΄λŠ”?

문자 μˆ˜λŠ” λ¬Έμžμ—΄μ˜ .length둜 UTF-16 μ½”λ“œ λ‹¨μœ„λ₯Ό μ…‰λ‹ˆλ‹€. λ°”μ΄νŠΈ μˆ˜λŠ” TextEncoder둜 UTF-8 μΈμ½”λ”©ν–ˆμ„ λ•Œμ˜ 크기λ₯Ό μΈ‘μ •ν•©λ‹ˆλ‹€. ASCII κΈ€μžλŠ” 1λ°”μ΄νŠΈ, ν•œκΈ€ μŒμ ˆμ€ 보톡 3λ°”μ΄νŠΈ, 이λͺ¨μ§€λŠ” λŒ€κ°œ 4λ°”μ΄νŠΈμž…λ‹ˆλ‹€.

쀄은 μ–΄λ–»κ²Œ μ„Έλ‚˜μš”?

μž…λ ₯을 μ€„λ°”κΏˆ 문자(\n)둜 λΆ„ν• ν•˜μ—¬ μ…‰λ‹ˆλ‹€. 빈 μž…λ ₯은 0쀄, ν›„ν–‰ μ€„λ°”κΏˆμ΄ μ—†λŠ” ν•œ 쀄 μž…λ ₯은 1μ€„λ‘œ λ‚˜μ˜΅λ‹ˆλ‹€.

제 ν…μŠ€νŠΈκ°€ μ„œλ²„λ‘œ μ „μ†‘λ˜λ‚˜μš”?

μ•„λ‹™λ‹ˆλ‹€. λͺ¨λ“  μΉ΄μš΄νŠΈλŠ” μž…λ ₯ν•˜λŠ” μ¦‰μ‹œ λΈŒλΌμš°μ €μ—μ„œ 둜컬둜 κ³„μ‚°λ©λ‹ˆλ‹€. ν…μŠ€νŠΈλŠ” κΈ°κΈ°λ₯Ό λ– λ‚˜μ§€ μ•ŠμœΌλ―€λ‘œ μ΄ˆμ•ˆ, λ©”μ‹œμ§€, λ―Όκ°ν•œ λ‚΄μš©μ—λ„ μ•ˆμ „ν•˜κ²Œ μ‚¬μš©ν•  수 μžˆμŠ΅λ‹ˆλ‹€.