# What does (printable) ASCII mean?

I think we should define once and for all what, unless specifically mentioned otherwise, we mean on this site when we say:

1. ASCII
2. Printable ASCII

There are many versions of (extended) ASCII, and I think we should have a default.

• This is one of the most contentious meta questions I've ever seen. Sep 3 '15 at 10:33

ASCII characters are all Unicode characters with code points from 0x00 to 0x7F (both inclusive).

Printable ASCII characters all are Unicode characters with code points from 0x20 to 0x7E (both inclusive). This does not include linefeeds.

This is consistent with the definition of printable character as one that occupies a printing position. Linefeeds are control characters that move the cursor down (or the paper up) and thus do not satisfy the definition of printability.

While including linefeeds in the printable ASCII characters would be practical if everybody was familiar with our convention, it is non-standard and bound to cause confusion. The spec of a challenge should be as long as needed to explain all the details, and adding and linefeeds doesn't make it a lot longer...

• I believe that including linefeeds should be the standard, as it would have to be mentioned as an exception a lot of questions.
– orlp
Sep 3 '15 at 3:03
• I don't think that saving a few bytes when writing up a challenge warrants using non-standard terminology that most readers of the challenge won't be familiar with. Sep 3 '15 at 3:05
• +1 This is the definition given by Wikipedia which I commonly link to in challenges. If I want newlines or tabs to be included as well I say so. Sep 3 '15 at 21:23
• @orlp If we really want a standard including linefeeds, that could only be called PPCG standard ASCII or something. Calling it by the name of something with a different definition is really confusing. Sep 4 '15 at 7:44

The definition of ASCII on this site should be the typical 7-bit ASCII, which contains 128 characters.

Printable ASCII includes the 95 characters found in this chart, which are listed below:

 !"#\$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_abcdefghijklmnopqrstuvwxyz{|}~


For the purposes of this site we should include the line feed character (\n) in this definition.

• IMO anyway. ¯\_(ツ)_/¯ Sep 3 '15 at 1:22
• What about \r?
– orlp
Sep 3 '15 at 1:32
• @orlp I wouldn't consider that printable. \n is a cross-platform line break and pretty much everything on this site that requires line breaks uses \n. I don't see the benefit of including \r as well. Sep 3 '15 at 1:34
• Every printable-ascii question I've checked does not inlude \n as printable. Sep 3 '15 at 7:39
• +1 Line breaks are technically printable, so why not include them? Sep 3 '15 at 10:15
• @BetaDecay They're not. A printable character is one that occupies a printing position. Sep 3 '15 at 17:35
• Including \n is plain confusing since when you Google "printable ascii" the first result is the Wikipedia article that clearly excludes \n. Sep 3 '15 at 21:29
• We should include tab character \t` in this definition too - it generates printable(!) spaces until horizontal position became multiple of 8. When analyzing program's output there should be no difference between printing 8 spaces and printing 1 tab. When printing on paper or when displaying text on computer monitor, the result is absolutely the same. Oct 17 '15 at 21:16