Sales tax in the US is charged to end-buyers by retailers only. The retailers file returns and remit the tax to the state. There is no national general sales tax in the US. Instead, each state governs sales tax at the state level and collects it from the merchants who have nexus (physical or economic presence) there. As of January 2019, 45 states plus the District of Columbia impose a general sales tax, five states (Alaska, Delaware, Montana, New Hampshire, Oregon) have no general sales tax. However, some local areas within these states may charge a sales tax. Sales tax rates vary by state and by locality within a state (a county, city, or any special taxing district).
There are different types of sales taxes imposed by the states. For example, some states collect taxes on an origin basis while others on a destination basis.
If a merchant is based in an origin-based state, sales tax must be charged at the rate of the state where the merchant is located. Therefore, a merchant's location (an office, a warehouse, or a place where the inventory is stored, etc.) becomes a basis for the sales tax calculation.
If a merchant has sales tax nexus in a destination-based state, sales tax is to be charged at the rate of the state where the product is delivered (customer ship-to address). Therefore, destination-based taxation is more complex, including state, county, city, and district tax rates. For example, California has the origin-based state, county, and city taxes, but the destination-based district taxes.
For either basis, the location is determined by the 5-digit zip code of either a store's business address or the customer's shipping address. The rates in effect for that zip code are then used in the tax calculations.
In addition, different states may have different rules for out-of-state merchants (remote sellers) who are selling into their states. A state considers a merchant a remote seller if they have sales tax nexus in that state but are not based there. Hence it's always necessary to consult an accountant or a local tax authority before configuring taxes in a store.
A state where a merchant collects sales tax also determines whether they should charge sales tax on shipping charges. Some states consider shipping charges a necessary part of a taxable eCommerce transaction and require online sellers to charge sales tax on any delivery charges. Other states do not require online sellers to charge sales tax on shipping charges if the cost is clearly separated from the price of the taxable products.
It is strongly recommended to consult an accountant or a local tax authority on the sales tax rates to ensure your store is configured correctly and collects the correct sales tax rate.