Play the song and stop it at the end of a chorus. Hum the note that feels finished, like the song could end right there. Find that note on your instrument. That's your tonic, and the song is probably in that key.
If you have the chords (or can work out a few), match them to a key. Every major key has the same pattern: 1, 2m, 3m, 4, 5, 6m. A song using G, C, D, Em fits G (1, 4, 5, 6m). A song using A, D, E, F#m fits A. The Nashville number chart lists every key so you can look it up.
The chord the song keeps returning to, and usually ends on, is the 1.
If home feels sad or dark, it's a minor key. Minor keys share chords with a major key (A minor uses the same chords as C major), so look at where the song resolves: on Am, it's A minor; on C, it's C major.
Chartless listens to whatever is playing on your phone, tablet, Mac or in Chrome and shows the key, the chords and the Nashville numbers as the song goes. It's the fastest answer when a song changes key, has a capo'd guitar, or was recorded a little sharp. The live chart is free.
More: chord transposer · chords in every key · figure out the chords by ear · transpose to another key · capo chart · all guides.