While they are in the same drug class (benzodiazepine derivatives) and they perform similar functions (act on GABA receptors to cut down on signals flowing through the central nervous system), their chemical structures are very different.
Xanax (generic: alprazolam) is a triazolobenzodiazepine.The chemical name of alprazolam is 8-Chloro-1-methyl-6-phenyl-4H-s-triazolo [4,3-I] [1,4] benzodiazepine.
Valium (generic: diazepam) is 1,4-benzodiazepine. The chemical name of diazepam is 7-chloro-1,3-dihydro-1-methyl-5-phenyl-2H-1,4-benzodiazepin-2-one.
The primary differences:
 half lives (how long they stay active in the body before they are cleaned out)
 valium has a mild muscle relaxant effect that xanax does not
We hope you find this general health information helpful. Please note however, that this Q&A is meant to support not replace the professional medical advice you receive from your doctor. No information in the Answers above is intended to diagnose or treat any condition. The views expressed in the Answers above belong to the individuals who posted them and do not necessarily reflect the views of Remedy Health Media. Remedy Health Media does not review or edit content posted by our community members, but reserves the right to remove any material it deems inappropriate.