Add custom line numbers to every line (e.g. 01. / | 1 |), or strip redundant line numbers copied from code
Add line numbers to every line with a custom template, or strip redundant line numbers copied from code. All local, nothing uploaded.
了解行号模板、去号规则与常见问题。Line-number templates, stripping rules, and answers to common questions.
文本行号工具支持两种操作:为每行文本添加自定义格式的行号(通过 {n} 占位符控制编号位置与格式),以及识别并去除行首常见的行号(如 12. 、12) 、| 1 | 、#12 等)。
This tool does two things: add custom line numbers to every line (using the {n} placeholder for position and format), and detect & strip common leading line numbers (like 12. , 12) , | 1 | , #12).
全部在浏览器本地完成,数据不会上传。
Everything runs locally in your browser - nothing is uploaded.
模板用 {n} 表示当前行号,其余字符原样输出。如 {n}. 生成 1. 、2. ;| {n} | 生成 | 1 |;#{n} 生成 #1。可设置起始编号、步长与零填充位数(如 2 位生成 01、02)。
Use {n} as the line-number placeholder; everything else is literal. E.g. {n}. makes 1. 、2. ;| {n} | makes | 1 |;#{n} makes #1. You can set the start value, step and zero-padding width (e.g. width 2 makes 01, 02).
默认跳过空行,保持文档空行结构不被编号。
Blank lines are skipped by default so the document's empty lines stay unnumbered.
只会去除行首「数字+分隔符」形态的格式,纯文本与代码不受影响;少数以数字+点开头的句子会被当作行号,请人工确认。Only leading "number + separator" patterns are removed; plain text and code are untouched. Sentences that happen to start with a number and a dot may be treated as line numbers - please double-check.
用 {n} 代表行号,其余字符照抄,如 "行{n}: " 生成 "行1: "。模板会在每行开头插入。Use {n} for the number and keep everything else literal, e.g. "Line {n}: " makes "Line 1: ". The template is prepended to each line.
默认不编号,保持空行空白;取消「空行不加号」后空行也会参与编号。By default blank lines stay blank; uncheck "skip blank lines" to number them too.