$title is something that has always confused me.
But I learned the correct answer today: it is neither.
The precise instant that is “noon” is the “M” in AM and PM (ante- and post-meridiem). So noon is properly “12M,” though the spoilsports at Wikipedia term this usage “antiquated.” (They do go on to call the modern US GPO style manual incorrect, though.) More modern usage appears to be to just say “12 noon.” But if you’re referring specifically to noon, “12am” or “12pm” are both incorrect. (In the same way that the year 2000 was neither pre-2000 nor post-2000.)
This does clear something up for me, though! My confusion has typically been about the whole hour of 12:xx. Is 12:30 (30 minutes past noon) a.m. or p.m.?
It turns out that I have been wrong. I assumed it was a.m., and that the switch happened when the 12 rolled over to 1. But the pedantic clarification of what a.m. and p.m. means makes this suddenly intuitive:
The equivalent for midnight is less clear, but it seems as though “12 p.m.” is generally accepted, with 12:00:01 being a.m.
Now you know.