ASCII art headers for source code comments

Copy ASCII art and block-letter banners as text for file headers and section comments in your code.

Loading the builder…

/WHY

A small piece of ASCII art at the top of a file, a script or a config gives a project a signature and makes important files easy to spot when scrolling.

The builder wraps any piece in the right comment markers for JavaScript, TypeScript, Python, Go, Rust, C, Shell, YAML, HTML, SQL and CSS, as line comments or a single block, adds a header line such as the project name and licence, and can turn everything into plain ASCII so it is safe in any file encoding.

/EXAMPLES

Ready-made examples to copy

Each one is complete. Copy it as it is, or change the piece name to any piece in the library.

File header with licence line

The most common use: art, project name and licence at the top of the main file.

//    ___   ___ _ __ ___   ___
//   / _ \ / __| '_ ` _ \ / _ \
//  | (_) | (__| | | | | |  __/
//   \___/ \___|_| |_| |_|\___|
//
// acme-sdk · MIT License · github.com/you/acme-sdk

Python docstring banner

As the module docstring, it also shows in help(module).

"""
   .-.
  (o o)  acme-cli
  | O \   Command line tools for Acme.
   \   \
    `~~~'
"""

import sys

Section dividers in a long file

Divider pieces make long files easier to scan.

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//  ROUTES
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

A message in the browser console

Developers who open the console on your site get a hello (and maybe a job link).

console.log(`%c
   _    ___ ___ ___ ___
  /_\  / __/ __|_ _|_ _|
 / _ \ \__ \__ \| | | |
/_/ \_\|___/___/___|___|

Like looking under the hood? We're hiring: example.com/jobs`, "font-family: monospace; color: #a3e635");

How to do it

  1. Make a banner with the banner maker, or pick a still frame from a divider.
  2. Copy it as text.
  3. Paste it inside a comment block in your language.

Open the banner maker

/GUIDE

Keep source files ASCII

Most tools handle UTF-8 today, but some older compilers, linters and terminals do not, and a single unusual character can break a build. Plain ASCII only (on by default) turns every block and box character into ordinary keyboard characters by how dark they are.

Line length

Many projects limit lines to 80, 100 or 120 characters and linters will flag a wider comment. Set the width below your limit, minus the comment marker.

Block comments that close early

A block comment ends at the first closing marker it meets, so art containing */ or --> would end the comment and break the file. The builder breaks those sequences up automatically when you choose One block.

Pieces that work well for this

Open any of them to copy the code or export.

/FAQS

ASCII art headers for source code comments: frequently asked questions

Q. How do I put ASCII art in code without breaking the file?
Wrap it in the right comment markers for your language and keep it to plain ASCII. The builder does both: pick the language, and it adds the line or block markers, removes trailing spaces, and breaks up any sequence that would close a block comment early. Paste the result at the top of the file.
Q. What is an ASCII comment header, and why use one?
An ASCII comment header is a small piece of text art, often with the project name and license, inside a comment at the top of a file. It gives a project a signature and makes important files easy to spot when scrolling or reading a diff. It has no effect on how the code runs.
Q. Which programming languages does the comment builder support?
It writes comments for JavaScript and TypeScript, Python, Go, Rust, C, C++ and Java, Shell and YAML, HTML, SQL and Lua, and CSS. Each language gets the right markers, such as // lines, # lines, -- lines, /* */ blocks, HTML comments or a Python docstring.
Q. Should I use line comments or one block comment for ASCII art?
Line comments are the safest choice, because each line stands alone and nothing can close the comment early. One block keeps the art clean with a single opening and closing marker. HTML and CSS have no line comments, so the builder always uses a block for them.
Q. What happens if the ASCII art contains a closing comment marker?
The builder breaks it up for you. A block comment ends at the first closing marker it meets, so art containing */, --> or three double quotes would end the comment early and break the file. In One block mode those sequences get a space inserted, which looks almost the same and keeps the file valid.
Q. Why should source files use plain ASCII only?
Some older compilers, linters, terminals and file encodings struggle with Unicode, and one unusual character can break a build. The Plain ASCII only option, on by default, swaps block and box characters for ordinary keyboard characters by how dark they are. Turn it off only if every tool you use reads UTF-8.
Q. How wide should ASCII art in a code comment be?
Narrower than your project's line length limit, minus the comment marker. Many projects cap lines at 80, 100 or 120 characters. The builder's width slider runs from 20 to 76 characters, with 44 as the default, and the height from 4 to 24 lines, so a header never pushes code far down.
Q. Will ASCII art in comments break my linter?
Usually not. Line length rules may flag a wide comment, so keep the width under your limit. Some linters flag trailing spaces, which the builder removes from every line. If a rule still complains, disable it for that block only rather than for the whole file.
Q. Can I put ASCII art in a Python docstring?
Yes. Choose Python and One block, and the builder wraps the art in triple quotes, ready to sit at the top of the file as the module docstring. A module docstring also shows when someone runs help on the module. Line comments with # work too if you prefer to keep the docstring for text.
Q. How do I add a project name and license line under the art?
Type it in the Header line field, for example your project name and MIT License separated by a bar. The builder adds it below the art inside the same comment, so the file header reads as one unit. Leave the field empty if you want the art alone.
Q. Can I put ASCII art in a JSON file or package.json?
No, because JSON has no comments and any extra text makes the file invalid. Put the art in the README instead, or in a config format that allows comments, such as YAML or JSON with comments. The Art only tab gives you the art without markers for those cases.
Q. How do I make a big-letter banner for a file header?
Use the banner maker at README banner maker: type your project name, pick a font, press Copy as text, and paste the letters inside a comment. For a wider choice of fonts and character sets in a static text banner, the text to ASCII generator at text to ASCII generator has more options.

Other ways to use it

Each one has its own builder.