Short answer
Divide the price by 1 plus the rate. At 18%, divide by 1.18. A price of ₹1,180 with GST included is ₹1,000 before tax, with ₹180 of GST. To add GST, multiply the price by the rate and add the result: ₹1,000 plus 18% is ₹1,180.
The two formulas
Adding GST: tax = price x rate, total = price + tax. At 18%, a ₹1,000 item becomes ₹1,180.
Removing GST from a price that already includes it: base = price / (1 + rate), tax = price minus base. At 18%, ₹1,499 becomes a base of ₹1,270.34 and tax of ₹228.66.
A common mistake is to take 18% off the inclusive price. That gives ₹1,229.18, which is wrong, because the 18% was charged on the base and not on the total.
CGST, SGST and IGST
If you sell to a buyer in the same state as your place of supply, the tax is split in half: CGST goes to the centre and SGST to the state. On ₹228.66 of tax that is ₹114.33 each.
If the buyer is in another state, the whole amount is IGST. The total tax is the same either way. Only the label and the split change, and your invoice must show the right one.
When the tax is an odd paisa, one of the two halves has to take it. Decide a rule, apply it every time, and make sure the halves add back to the whole.
Pricing a basket
Real orders mix rates. A shirt may carry one rate and an accessory another, and shipping you charge is usually taxed too, often at the rate of the goods it ships with. Work out each line at its own rate, then add the lines.
Rounding matters at scale. You can round the tax on each line, or add the unrounded tax and round once on the invoice. The two can differ by a few paisa. Pick one method, check it against your accounting software, and use it everywhere.
If an item has a cess on top of GST, add it as a separate line of tax so the invoice shows it plainly.
Which rate to use
The rate depends on the HSN code of what you sell. Rates are set by the GST Council and they change, so read the current notification for your code or ask your accountant. Do not rely on a rate you remembered from last year.
The calculator on this site has rate shortcuts, but they are shortcuts and not advice.
Checks before you publish prices
Decide whether your displayed prices include GST, and say so on the product page and at checkout. Make sure the price in your ads and product feed matches the price a shopper pays, or the feed can be disapproved.
If you are registered, your invoice needs the base amount, the tax split and the right rate on every line. If you are not registered, you cannot charge GST at all.