All surviving Confederate service records are on Fold3.com. Many (but not all) of the those records are also on the National Archives web site HERE.
Fold3 also includes Union service records for regiments from Massachusetts, Vermont, all of the border states (Missouri, Kentucky, West Virginia, D.C., Maryland, Delaware), all of the southern states (i.e., Union regiments that were formed in the south), plus the western states/territories of OR, CA, UT, KS, and the Dakotas. In addition, Fold3 contains all of the service records for the U.S. Colored Troops and the 1st New York Engineers. Many (but not all) of the those records are also on the National Archives web site HERE.
All other Union service records are available only at the National Archives in Washington D.C. or can be ordered from us HERE.
Note that Fold3.com is a subscription service but there are a variety of legal ways to access it for free as described on our blog HERE.