Thanks for coming to, the world's #1 resource for all things InDesign!

Quickly Add Line Numbers With This Free Script

Occasionally, I'll read requests from users that for whatever reason need to have line numbers in their document.

Our friend Harbs at In-Tools has just posted a free script that does this quickly and easily on a page by page and style by style basis. The script is significantly different than InDesign's built in numbering feature in that it numbers lines, not paragraphs. It works through the use of anchored objects and allows the user to choose which styles to add line numbers to. The anchored objects use object styles and numbers use paragraph styles making the look and feel quite simple to adjust.

With hidden character displayed, the secret behind this script is revealed.

You can read more and download the script from this page on In-Tools website.

Bob Levine
Bob Levine is a graphic designer and a consultant focused on providing InDesign training and guidance in developing efficient, collaborative workflows to those moving from QuarkXPress or PageMaker. An Adobe Certified Expert in both InDesign and InCopy, Bob has written articles for InDesign Magazine and is an Adobe User to User forums host. He has more than 15 years of industry experience and has been using InDesign since version 1.0. For more background, visit his website, or his blog,
Related Articles

11 Comments on “Quickly Add Line Numbers With This Free Script

  1. A couple of issues to note:
    1. It will break hyphenation because it injects the line number anchors at the start of each paragraph (which may be within a hyphenated word).
    2. It’s a bit wonky for multi-column text frames. The default places the numbers to the left of the text frame (which creates overlapping numbers) and InDesign doesn’t support mirror placements (outside left for column 1; outside right for column 2).
    3. You shouldn’t run the script multiple times on the same document as it doesn’t clean up the previously applied numbers first (which can result in duplicate/overlapping numbers).

  2. Hi Bob,

    For #2, you can apply different paragraph styles like Line Number (Column1) and Line Number (Column 2).

    Additionally, I have two feedbacks on this tool:

    (1) Giving option to the users to generate Line numbers for whole document, currently tool is running only in the active page

    (2) Checking the possiblity to avoid the disturbances of line endings sometimes while adding/removing the line numbers

    (3) Providing the option to the users to remove the Line numbers when they are not required, currently tool is removing Line numbers only when the Line numbers are already found during generation



  3. Hi there, just became aware of your blog through Google, and found that it is truly informative.
    I am gonna watch out for brussels. I’ll be grateful if you continue this in future.
    Many people will be benefited from your writing.

Leave a Reply

Your email address will not be published. Required fields are marked *