Pular para o conteúdo principal

Contador de Linhas

Conte linhas em texto colado ou enviado — total de linhas, linhas em branco, linhas não-branco, palavras e caracteres. Processa corretamente terminações de linha mistas (CRLF/LF/CR), com atualização em tempo real conforme você digita.

Entrada

Drop a file or browse
One file · text
Ou

Saída

Estatísticas de Linhas

Resultado
MétricaValor
No data yet
Isso foi útil?

Mais formas de usar esta ferramenta

API REST

curl -X POST https://api.iotools.cloud/v1/tool/line-counter \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "inputText": "This is line 1\nThis is line 2\n\nThis is line 4 af…"
  }'

Troque pela sua própria chave, da sua conta. Os campos da ferramenta viram o corpo da requisição — sem envelope.

Peça a um agente de IA

Use the IOTools `line-counter` tool (Line Counter) on this input:

YOUR_INPUT_HERE

Cole isto em qualquer agente conectado ao servidor MCP do IOTools e depois adicione sua entrada.

Widget para incorporar

<iframe
  src="https://iotools.cloud/embed/line-counter/"
  width="100%" height="520" frameborder="0" scrolling="no" loading="lazy"
  title="Contador de Linhas — iotools.cloud"
  sandbox="allow-scripts allow-forms allow-same-origin allow-downloads allow-popups allow-popups-to-escape-sandbox"
  allow="clipboard-write"
  style="width:100%;border:1px solid #e5e7eb;border-radius:12px;overflow:hidden"></iframe>
<script src="https://iotools.cloud/embed.js" async></script>

Coloque isso na sua própria página — grátis, sem chave, só um link de volta.

Custo por chamada de API/MCPA partir de 5 créditos
Precisa de mais créditos?Ver preços

Também disponível via

Guias

What does this line counter measure?

Paste or upload any block of text and get an instant breakdown: total lines, non-blank lines, blank lines, words and characters. It's built for anyone who needs an accurate line count without opening a code editor or spreadsheet — logs, CSV exports, source code, poetry, scripts, config files, or plain prose.

A line is counted the same way your text editor counts it: every line break — whether it's a Unix \n, a Windows \r\n, or an old Mac \r — ends one line and starts the next. Files with mixed line endings (common after copy-pasting between operating systems, or concatenating files from different sources) are counted correctly instead of inflating the total when a \r\n gets miscounted as two breaks.

A line counts as blank when it's empty or contains only whitespace (spaces, tabs) — trimmed before the check, so a line with a few stray spaces still counts as blank rather than "non-blank." Non-blank lines are simply the total minus the blanks.

Who is it for?

  • Developers checking the size of a script, log file, or config before pasting it somewhere with a line limit.
  • Writers and editors counting lines in a poem, screenplay, or formatted manuscript where line breaks matter more than word count.
  • Data and QA folks doing a quick sanity check on a CSV or export — total rows, and how many are actually empty.
  • Anyone who just got a "how many lines is that file" question and doesn't want to open a terminal.

How to use it

  1. Paste your text into the box, or drop a .txt file onto the uploader — the file's contents load straight into the text box.
  2. Read the stats table: total lines, non-blank lines, blank lines, words, and characters, all updated live as you type or edit.
  3. Copy a value or re-paste different text — the count refreshes instantly with no need to click a button.

Why do CRLF and LF matter?

Windows text files typically end each line with \r\n (carriage return + line feed), while Unix, Linux and macOS use just \n. Some older tools and legacy Mac files use a lone \r. If a tool naively counts every \r and every \n as separate breaks, a Windows-style file ends up reporting roughly double its real line count. This counter treats \r\n, \n, and \r each as exactly one line break, so the same content reports the same line count no matter which platform it came from.

What counts as a blank line?

Any line that is empty, or contains only spaces/tabs, is counted as blank. A line with visible text — even a single character — counts as non-blank.

Privacy

Counting happens entirely in your browser. Your text never leaves your device, and uploaded files are read locally — nothing is sent to a server.

textcounterlineswriting

Parte de uma cadeia

Todas as cadeias

Ama as ferramentas? Livre-se dos anúncios.

Um único pagamento remove todos os anúncios da sua conta, para sempre. Sem assinatura, sem rastreamento.