The concept of oxidation in chemistry is a somewhat confusing one, mostly because it predates an understanding of the structure of the atom and how chemical reactions occur. The term originated when chemists were analyzing reactions involving oxygen, which was the first known oxidizing agent.
To modern chemists familiar with the exchange of electrons in reactions, oxidation refers to the loss of electrons and reduction to the gain of electrons. The modern definition applies to reactions that involve oxygen as well as those that don't, such as the production of methane (CH4) from carbon and hydrogen. When you add oxygen to methane to produce carbon dioxide and water, that's also oxidation. The carbon atom loses electrons, and its oxidation state changes while the oxygen atoms gain electrons and are reduced. This is known as a redox reaction.
TL;DR (Too Long; Didn't Read)
The oxidation state of carbon in the methane molecule is -4 while that of hydrogen is +1.
The Oxidation State of Carbon in Methane
Because of its four valence electrons, carbon can exist in a variety of oxidation states, ranging from +4 to -4. That's why it forms so many compounds, more than any other element. To determine its state in a particular compound, you generally have to look at the bonds it forms with the other elements in the compound.
Hydrogen has only one valence electron, and since that electron is in its first shell, it needs only one electron to fill the shell. This makes it an electron attractor with an oxidation state of +1. Hydrogen can also lose an electron and exist in a -1 oxidation state when it combines with Group 1 metals to form metal hydrides, such as NaH and LiH, but in most cases, such as when it combines with carbon, it's always in the +1 oxidation state.
To compute the oxidation state of carbon in the methane molecule, you treat each carbon-hydrogen bond as if it were ionic. The molecule has no net charge, so the sum of all the carbon-hydrogen bonds has to be 0. This means the carbon atom donates four electrons, which makes its oxidation state -4.
The Oxidation State of Carbon Changes When You Burn Methane
When you combine methane with oxygen, the products are carbon dioxide, water and energy in the form of heat and light. The balanced equation for this reaction is
CH4 + 2 O2 -> CO2 + 2 H2O + energy
Carbon undergoes a dramatic change in its oxidation state in this reaction. Whereas its oxidation number in methane is -4, in carbon dioxide, it's +4. That's because oxygen is an electron acceptor which always has an oxidation state of -2, and there are two oxygen atoms for every carbon atom in CO2. The oxidation state of hydrogen, on the other hand, remains unchanged.