The same character is a typographic mark, a topic tag and an instruction to ignore the rest of a line.
The character is one thing; what reads it decides the meaning. Before a word on social media it makes a tag. Before a numeral it means 'number'. At the start of a line in a shell script, Python or most configuration formats it means everything after it is a comment and is ignored. A hash inside a string is none of these.
The same character. Most scripting languages use it to mark the rest of a line as a comment.
Drawn from the visual attributes recorded for each symbol. Only traits the two records disagree about are listed.
| Trait | Number sign | Hash comment marker |
|---|---|---|
| Symmetry | point | none |
| Number sign | Hash comment marker | |
|---|---|---|
| Reader | A person | An interpreter |
| Effect | Labels or numbers something | Makes the rest of the line invisible to the program |
| Position matters | Before the thing labelled | Yes — the rest of the line is what it affects |
| Defined by | Typographic convention | POSIX for shells; convention elsewhere |
| Relationship (from Symbolwise's records) | Commonly confused with Hash comment marker — The same character. Most scripting languages use it to mark the rest of a line as a comment. | Commonly confused with Number sign — The same character. The number sign is the typographic mark; this is one of the jobs programming languages give it. |
Unicode Code Chart: Basic Latin (U+0000–U+007F)
The Unicode Consortium · retrieved 2026-07-30
Authoritative for the character's code point, name and block only. Unicode assigns identity; it does not define what a symbol means in use.
Wikipedia · retrieved 2026-07-30
Tertiary reference. Used for widely-agreed identity and origin summary, not for contested detail or exact dates.
POSIX.1-2024, Shell Command Language
The Open Group / IEEE · retrieved 2026-08-01
Cited for the shell's operator grammar — which characters are operators and what they do — and for nothing outside it. It standardises a notation that already existed rather than inventing one, so records here describe documented practice that POSIX also pins down.
Comment (computer programming)
Wikipedia · retrieved 2026-08-01
Tertiary reference. Used for widely-agreed identity, origin and current use, not for contested detail or exact dates.
They are not variants of each other. # is the number sign — hash, hashtag, and the 'pound key' on a North American telephone keypad. £ is the pound sterling currency sign, from the Latin libra. The only thing they share is the word people say out loud.
Look at which strokes slant. The musical sharp has upright verticals and horizontals that slant slightly upward; the number sign is the other way round, with slanted verticals and level horizontals. They are separate Unicode characters — U+266F and U+0023 — and text search, sorting and filenames all treat them as different.
A shebang starts with the same hash that marks a comment, followed by an exclamation mark, and it must be the very first two bytes of the file. The kernel reads it to find the interpreter; the interpreter then reads the same line as an ordinary comment and ignores it. A blank line before it makes it only a comment, and the file will not run as intended.
Both are drawn as one continuous decorative stroke with a closed loop and a tail that crosses back over itself, which is why a description of the shape alone reaches both. The clef is far taller, spans a stave, and its spiral encircles one specific line — that encircled line is the note G, and it is the only reason the shape is drawn where it is.