When describing a person without siblings, should I say "the -" or "an only child"?

I understand the phrase "only child" means the only person born from or adopted by a set of parents in a family, or a person with no siblings. I often hear the term used as "an only child," which does not appear to be grammatically correct, but does appear to be the correct usage of the term. I have sometimes used "the only child" instead. Which phrase is correct? Is "the only child" incorrect?


Solution 1:

X is "the only child" of his parents, and "an only child" along with Y and Z. Similarly, I am "the" elder child of my parents and "an" elder (and eldest) child along with bunches of other people.

One refers to the specific situation; the other refers to the classification.

Edited to add:

Consider the following examples:

"The":

Census interviewer: Do your parents have any other children besides you?
Teenager: No, I'm the only child.

"An":

Bob: I'm an only child.
Sue: You too? Did you also experience (...)?

Now what happens if Bob says "the" instead of "an"?

Bob: I'm the only child.
Sue: Gee, I thought you were an adult.
Bill: There are several children in this room.

Bob can correct this problem with the somewhat cumbersome phrase:

Bob: I'm the only child of my parents.

Solution 2:

Although at first glance "an only child" sounds ungrammatical, in fact "only child" is a noun in and of itself. From the Cambridge online dictionary:

only child, noun (plural only children)

Definition: a child who has no sisters or brothers

As for using "the only child", I don't see why it would be considered incorrect. In a different context, one might say "the only jar on the shelf". Your version of the phrase is grammatical, but the compound noun above is the one people may be expecting in that given context.