I'm a programmer and I often see the abbreviation ID (capitalized) in technical documents and code. Is this correct, or should it be id?

  • 3
    Capitalization (in code) is specific to the conventions of the programming language, not the language used for naming the variables (usually English). In C#, you'd encounter Id for a public property, id for a local variable, _id for a private property, and ID for a constant value. For technical documentation, it varies: if you're referring to a code variable/property/const, then you should use the same capitalization.
    – Flater
    Oct 13, 2017 at 9:27
  • 4
    @Flater - If you want to see real fireworks, migrate this to a programming Stack Exchange. I bet it would engender passionate responses.
    – iMerchant
    Oct 13, 2017 at 9:44
  • 1
    @iMerchant: Regardless, those passionate responses would all be advocating the use of different capitalizations for different circumstances (even if they can't agree on which to use where).
    – Flater
    Oct 13, 2017 at 10:05
  • 1
    Agreed. Ideally the OP would clarify which language he is using. But since his question is nearly five years old and he’s only accumulated 61 rep points in the meantime, it’s safe to assume he is long gone and any of our comments/answers are moot at this point. But hey, it’s still fun to comment regardless. As for the fireworks, who doesn’t like watching fireworks?
    – iMerchant
    Oct 13, 2017 at 10:17

6 Answers 6


In English, both letters should be capitalized ("ID"). The lower case word "id" has a specific meaning that does not invoke the meaning "identifier," or "identification." In documentation it should be spelled out (ID abbreviates two different words, after all), or be in all caps.

However, programming languages are not exactly English. Styles vary widely. The de facto standard nowadays seems to be CamelCase, in which even identifiers such as acronyms capitalize the first letter only:

Id, myId, aSpecificId

But the whole question is prone to "religious wars" in the programming world, and there is no definitive answer. Some insist that the first letter always be capitalized, some the first letter only of following words (sometimes known as "camelCase" to distinguish from "PascalCase").

  • 4
    ID abbreviates identification. Which other word? Indonesia?
    – Synesso
    Jul 24, 2015 at 2:04
  • 6
    In terms of programming capitalising both seems odd to me. It's not usually NOT an acronym for "identity document" or similar in these contexts, it's simply an abbreviation of "identifier" as it's usually a number or string. I think this is why it's very commonly camel-cased.
    – Vala
    Aug 19, 2016 at 8:54
  • 2
    Yes, as @Synesso asks, what is the other word in included in the so-called acronym? In English we have many homonyms, and we don't artificially capitalise one variant to differentiate it from other variants. Although, I must admit I'm a software developer, and the all upper case version annoys the crap out of me, and interferes with word separation in longish class,property, function, etc. names.
    – ProfK
    Sep 13, 2016 at 2:51
  • 1
    The de facto standard nowadays seems to be CamelCase. More often than not, there are different capitalizations (in the same language) based on what sort of variable you're trying to name. In C#, you'd encounter Id for a public property, id for a local variable, _id for a private property, and ID for a constant value.
    – Flater
    Oct 13, 2017 at 9:30
  • 1
    Re. English language: 1. "id" meaning "part of the mind" should not be capitalized. 2. "ID" meaning abbreviation for "identifier" or acronym for "identifier document" should be capitalized...
    – Tom
    Oct 17, 2018 at 22:11

I agree common usage is ID. This is because ID is an abbreviation for identity document. So when ID is used for identifier it has an understood meaning. Language does evolve in this way.

On proper English. Identifier is only one word so I choose to use Id. Such as PhD, Mr, Ms, SciFi, Jr, Sr, Lt, Lt Col, and Prof. I'm sure more examples can be found.

The only counter example I can find is TV and even then I wouldn't be surprised if it evolved as well from a hyphen or two words.

If you're programming, as most people searching for this are, the way you spell it in code is determined by the coding standards put forth by your architect or lead.

Edit: Changed word acronym to abbreviation. The content still maintains such as in GMO, genetically modified organism. If anyone doesn't believe Identity Document is a thing, https://en.wikipedia.org/wiki/Identity_document where it will show that ID is used as an abbreviation for Identity Document.

  • You should probably edit to account for the fact that "ID" actually "Identity Document"? There's an edit link below the question. May 22, 2018 at 23:47
  • "Identifier" and "identity document" aren't the same thing. However this great answer does service to both usages. Jul 11, 2018 at 15:54
  • 1
    I'd add that "identifier" is a technical term, plenty of industry standards use it (frequently written as "id" or "ID", I wasn't able to find a standard capitalizing as "Id"), and one can often locate the closest applicable standard and follow its practice in similar cases. Furthermore, be sensitive to whether the context is actually English prose, table heading, a programming language with its own capitalization rules, etc. Jul 11, 2018 at 15:54
  • 1
    Although "ID" certainly can stand for "Identity Document", it is not correct to say that it always does so: in "GUID", the "ID" stands simply for "identifier". It may be that the "Identity Document" usage is the original, and other uses came from there, but I've not yet seen a reference proving that.
    – IMSoP
    Jan 29, 2021 at 13:20

In common English, ID is used from common practice. In programming, though, it's sometimes id. The reason it's capitalized for common English is that there's no period at the end of the abbreviation, unlike abbreviations like tsp., lb., or abbr. Abbreviations also see demotion from capitalization by common use. Capitalization in programming isn't dictated by capitalization in common English but instead by the group of programmers. PascalCase or camelCase or snake_case, it comes down to preference and convention in the language.

  • 3
    I am a programmer, and have been for decades, but I have never once used id. Not even in source code, let alone in the documentation. It's always ID. Same for my colleagues. So I'd like to see your statement backed up with actual data. Otherwise it's just your anecdotal evidence vs. my anecdotal evidence.
    – RegDwigнt
    Jan 23, 2013 at 21:16
  • Hard thing to find. It must be just anecdotal evidence. I'd never seen id capitalized ID before, but almost all of my experience in programming has been academic, either research programming or otherwise academic programming. It may be one of those academic vs corporate coding differences I seem to discover all the time.
    – calben
    Jan 23, 2013 at 22:40
  • 2
    I don't think you're going to get much anything other than anecdotal 'evidence' on this one though. The answer to the original question is that it can be either. I've seen more of id in my programming experience.
    – calben
    Jan 23, 2013 at 22:43
  • 1
    There are many different programming ecosystems, they can have very different standards. In some languages the default is camelCase or CamelCase, in some snake_case, in some kebab-case. In the last two, ID will almost always be lower case. In programming you should follow the language conventions over grammar. If you want a clear specific example, in HTML IDs are explicitly lower case: w3.org/TR/html401/struct/global.html#h-7.5.2
    – Korny
    Feb 24, 2015 at 11:40
  • 2
    my id says Id use id, ID, id, id., Id or even iD and most readers will discern the proper meaning
    – Kirby
    Aug 23, 2016 at 4:02
  1. In English: ID has been arbitrarily chosen to be uppercase, only for convenience, only to distinguish it from the other meanings of the word "id". It is not an acronym like SQL, ASCII or NASA. (Strictly speaking it is incorrect, but now it is the convention.)

  2. In programming, if the convention for your specific programming language is requiring camelCase or PascalCase, then you should simply use id or Id (eg: shopId, ShopId), and iD and ID are incorrect. Just like for SQL you should use sql or Sql.

  • I'd say "ID" is an initialism for "Identity Document". It's not an acronym, no, but neither is SQL in my book. NASA and ASCII are acronyms though, as far as I am concerned. If the word being abbreviated is "identifier", I'd use lower case "id" as a starting point, then let the capitalization convention of the language and project take second effect.
    – Victor
    Nov 4, 2019 at 12:47
  • 2
    @victor, ID is more far more commonly an abbreviation of "identifier" (or "identification"), not Identity Document. I've worked in several industries and have not encountered the latter. It's likely scoped to legal fields, etc.
    – isherwood
    Jan 6, 2020 at 15:41
  • @isherwood but your use of capitalized "ID" implies it's an initialism. As far as I'm concerned, abbreviations aren't capitalized. So "ID" is different from "id." or "id".
    – Victor
    Jan 6, 2020 at 16:12
  • It's not my use, as most of the answers on this page indicate.
    – isherwood
    Jan 6, 2020 at 16:12
  • 2
    @Victor you seem to rely on the notion that an initialism must be formed from the initials of multiple words, which is not the case. While that is where the word "initialism" comes from, it is not a hard and fast requirement. Initialisms are abbreviations that are pronounced one letter at a time. For example, ECG is an initialism, even though "electrocardiogram" is one word. Similarly, ID is an initialism and can correctly be capitalized even if it derives from "identity" or "identifier"
    – Flater
    Jan 29, 2021 at 13:48

Although it might be logical to treat "id." as a straight-forward abbreviation for "identity" or "identifier", common usage is to both write and pronounce it as the two separate letters "I" and "D".

See for instance Lexico (based on Oxford dictionaries), the Guardian Style Guide (UK), Chambers, Merriam-Webster (note that some of these feature multiple terms spelled with variants of "id", "Id", etc, but all show "identity" abbreviated to "ID").

I can think of a few reasons why this might be, but have been unable to find evidence for any of them:

  • It may have originated as an abbreviation of "Identity Document", and then became applied more generally - for instance, the phrase "show me your ID" may well be referring to a document, while "make a positive ID" certainly does not, but may be a later usage.
  • The word "id" does have at least one established meaning, although one not used all that commonly outside philosophy, so it's influence is likely to have been small.
  • The first sound in "identity" is the long vowel used when saying the letter "I", not the short vowel which would naturally be read from the spelling "id". A single syllable pronunciation with a long vowel would probably be written "ide.", and would be the same as the very common word "I'd" (abbreviating "I had").

Whatever the reason, "ID" is the common spelling, and in that sense "correct".

As ever, there are exceptions to the rule:

  • When combined into a longer abbreviation that is pronounceable, that abbreviation might come to be spelled as such in some style guides, e.g. you might decide to accept "Guid" (pronounced "goo-id") for "GUID".
  • In some contexts, such as the "camelCase" names often used in programming, it might be considered inconvenient or ugly to have multiple capital letters in a row, e.g. you might decide to use "userId" rather than "userID".
  • @Flater I have now added two references for the spelling itself, which is more than any of the other answers on this page. I haven't been able to find any references to the etymology behind that spelling, which is why I included multiple possibilities.
    – IMSoP
    Jan 29, 2021 at 14:12

It all depends on context.

ID is the abbreviated initialism of "Identification Document", but this abbreviation is similar to the abbreviation of the single word Identifier, which is "Id".

If you are referring to a student ID or a driver's license number as their ID number, then use ID since the letters should all be capitalized to indicate to the reader that it stands for multiple words.

If you are a programmer and you are referring to the row number of a record in a table, then you are referring to a Unique identity or Unique identifier, both of which can be referred to an Id. Because the letters are only representing a single word the "d" should never be capitalized.

As answered before, do not use id, as that is a psychological term. (id, ego, super-ego)

  • 1
    Please recognise that ELU practice is to go with the default definitions of respected dictionaries, which reserve 'acronym' for cases where abbreviations are not 'spelled out'. NASA yes, but BBC, an initialism. Apr 20, 2022 at 16:50
  • 1
    You are absolutely correct. FBI, CIA, DEA, DOT and ID are all initialisms not acronyms. Thank you for the constructive feedback.
    – Tom Graham
    May 17, 2022 at 17:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.