Metallic nitrates, when heated, give out oxygen. At the same time, most of them also give out a reddish brown gas - nitrogen dioxide, NO
2. Thus, these nitrates cannot be used to prepare oxygen. However, sodium and potassium nitrates do not produce nitrogen dioxide. When these two nitrates are heated, they first melt and then readily decompose to yield oxygen.
