단어 카운터
단어, 문자, 문장, 단락 수를 세고 읽기 시간 추정
0
단어
0
문자
0
문자 (공백 제외)
0
문장
0
단락
—
읽기 시간
—
말하기 시간
텍스트 입력
단어 카운팅이란?
단어 카운터는 텍스트에 포함된 단어, 문자, 문장, 단락의 수를 알려줍니다. 입력값을 공백 기준으로 분리하고, 패턴 기반 규칙을 적용해 문장과 단락을 감지합니다. '단어'의 정의는 언어, 문자 체계, 맥락에 따라 다릅니다. 영어에서는 공백으로 구분된 토큰이 잘 작동합니다. 한중일(CJK) 언어에서는 단어가 공백으로 구분되지 않으므로, ICU의 BreakIterator 같은 사전 기반 알고리즘으로 분절해야 합니다.
문자 수 계산에는 두 가지 일반적인 정의가 있습니다. 공백 포함과 공백 제외입니다. 전체 문자 수에는 공백, 탭, 줄바꿈 문자를 포함한 모든 Unicode 코드 포인트가 포함됩니다. 공백 제외 문자 수는 계산 전에 모든 공백을 제거하며, Twitter(현 X)의 게시물 길이 제한이나 문자당 요금을 부과하는 번역사들이 사용하는 기준입니다. 엄격한 길이 제한이 있는 시스템에 텍스트를 붙여넣을 때 이 구분이 중요합니다.
읽기 시간과 말하기 시간 추정은 단어 수를 평균 속도로 나눈 값입니다. Journal of Memory and Language에 발표된 연구(Brysbaert, 2019)에 따르면 영어 산문의 평균 묵독 속도는 분당 238단어입니다. 프레젠테이션 말하기 속도는 일반적으로 분당 130~160단어입니다. 이 평균값은 텍스트 난이도, 독자, 언어에 따라 달라지지만, 블로그 포스트, 문서, 슬라이드 덱 작성에 실용적인 기준을 제공합니다.
이 단어 카운터를 사용해야 하는 이유
텍스트를 붙여넣으면 계정 생성이나 네트워크로의 데이터 전송 없이 단어, 문자, 문장, 단락 수를 실시간으로 확인할 수 있습니다.
단어 카운터 활용 사례
텍스트 지표 참고
이 도구가 보고하는 각 지표에는 구체적인 정의가 있습니다. 아래 표는 각 지표의 계산 방식을 보여줍니다.
| 지표 | 계산 방식 | 예시 |
|---|---|---|
| Words | Sequences separated by whitespace | "hello world" → 2 |
| Characters | All characters including spaces | "hi there" → 8 |
| Characters (no spaces) | Letters, digits, punctuation only | "hi there" → 7 |
| Sentences | Segments ending with . ? or ! | "Hi. Bye!" → 2 |
| Paragraphs | Text blocks separated by blank lines | "A\n\nB" → 2 |
| Reading time | Word count ÷ 238 wpm (silent reading avg) | 1 000 words → ~4.2 min |
| Speaking time | Word count ÷ 150 wpm (presentation pace) | 1 000 words → ~6.7 min |
단어 수 vs. 문자 수
이 두 지표는 서로 다른 질문에 답합니다. 잘못된 지표를 선택하면 제출 거절이나 레이아웃 문제가 발생할 수 있습니다.
코드 예시
다양한 언어로 단어와 문자 수를 프로그래밍 방식으로 계산하는 방법입니다. 각 예시는 일관된 비교를 위해 동일한 입력 문자열을 처리합니다.
// Word count — split on whitespace, filter empty strings const text = 'Hello world! How are you?' const words = text.trim().split(/\s+/).filter(Boolean) console.log(words.length) // → 5 // Character count console.log(text.length) // → 27 (with spaces) console.log(text.replace(/\s/g, '').length) // → 22 (without spaces) // Sentence count — split on sentence-ending punctuation const sentences = text.split(/[.!?]+/).filter(s => s.trim().length > 0) console.log(sentences.length) // → 2 // Reading time estimate (238 wpm average) const readingMin = words.length / 238 console.log(Math.ceil(readingMin)) // → 1 min
import re
text = 'Hello world! How are you?'
# Word count
words = text.split()
print(len(words)) # → 5
# Character counts
print(len(text)) # → 27 (with spaces)
print(len(text.replace(' ', ''))) # → 22 (without spaces)
# Sentence count
sentences = [s for s in re.split(r'[.!?]+', text) if s.strip()]
print(len(sentences)) # → 2
# Paragraph count
multiline = """First paragraph.
Second paragraph."""
paragraphs = [p for p in multiline.split('\n\n') if p.strip()]
print(len(paragraphs)) # → 2package main
import (
"fmt"
"strings"
"unicode"
)
func main() {
text := "Hello world! How are you?"
// Word count
words := strings.Fields(text)
fmt.Println(len(words)) // → 5
// Character count (rune-aware for Unicode)
fmt.Println(len([]rune(text))) // → 27
// Characters without spaces
noSpaces := strings.Map(func(r rune) rune {
if unicode.IsSpace(r) {
return -1
}
return r
}, text)
fmt.Println(len([]rune(noSpaces))) // → 22
}# Word count echo "Hello world" | wc -w # → 2 # Character count (bytes — use wc -m for multibyte chars) echo -n "Hello world" | wc -m # → 11 # Line count echo -e "line1\nline2\nline3" | wc -l # → 3 # Count words in a file wc -w < article.txt # → 4230