The process, called carbonization, drives off volatile components like water, methane, and tar, leaving behind a porous, solid carbon-rich residue.
The composition of coke varies depending on the type of coal used, but it's primarily composed of carbon, with small amounts of other elements like hydrogen, sulfur, and nitrogen.