Any chord might show up in any key, but some chords are much more likely than others. The most likely chords to show up in a key are the chords that you can make in that key without using accidentals. So these chords have both names and numbers that tell how they fit into the key. (We'll just talk about basic triads for the moment, not sevenths or other added-note chords). The chords are numbered using Roman numerals from I to vii.
You can find all the basic triads that are possible in a key by building one triad, in the key, on each note of the scale (each scale degree). One easy way to name all these chords is just to number them: the chord that starts on the first note of the scale is "I", the chord that starts on the next scale degree is "ii", and so on. Roman numerals are used to number the chords. Capital Roman numerals are used for major chords and small Roman numerals for minor chords. Because major scales always follow the same pattern, the pattern of major and minor chords is always the same in a major key. The chords built on the first, fourth, and fifth degrees of the scale are always major chords (I, IV, and V). The chords built on the second, third, and sixth degrees of the scale are always minor chords (ii, iii, and vi). And the chord built on the seventh degree of the scale is a diminished chord.
Write and name the chords in G major and in B flat major.
Notice that IV in the key of B flat is an E flat major chord, not an E major chord, and vii in the key of G is F sharp diminished, not F diminished. If you can't name the scale notes in a key, you may find it difficult to predict whether a chord should be based on a sharp, flat, or natural note. If you read music, learn your scales; they are very useful for many different reasons. (See
Major Keys and Scales.) If you don't read music, and are not planning to learn, you may find it easiest to simply memorize the most important chords (at least I, IV, and V) in your favorite keys.