The USCIS website has a calculator that helps you calculate filing fees according to your form type. The tool can calculate both fixed and variable fees.
If your fee is variable, then the software will ask some additional questions to give you the figure. For example, to calculate N-400 filing fees, the software asks you for your age and if you’re a military applicant or not.
The options you have for paying your filing fees will depend on your location and the form you’re filing. If you’re inside the U.S., you may be able to pay online with your card or bank; by mail with a money order, card, or check; or at the field office. Note that filing fees are final and non-refundable.