🎉 Celebrate with 10% OFF on All Products! Use Code: GFEX10 Or Buy Any 2+ Items for 30% OFF with Code: GFEX30!
Guides & Tutorials November 9, 2026

How to Check Bank Details in Gravity Forms: Sort Codes, Routing Numbers and More

GravityExtra
How to Check Bank Details in Gravity Forms: Sort Codes, Routing Numbers and More

A direct debit that bounces because of one wrong digit costs more than the fee you were collecting. The member gets a letter, your office makes a phone call, and the next collection slips by a month. Payroll forms, supplier set-up forms and refund requests have the same problem: bank details are typed by people in a hurry, and a swapped pair of digits looks perfectly normal on screen.

Gravity Forms has no bank account field of its own. This guide shows how to collect bank details in a Gravity Forms form and check them before the form is sent: UK sort codes and account numbers with the modulus rules, US routing numbers, and New Zealand, Australian and Canadian bank details.

Why a plain text field is not enough

The usual set-up is two Single Line Text fields, “Sort code” and “Account number”, maybe with an input mask. A mask makes sure the visitor typed six digits, but it cannot tell whether those six digits and the account number belong together. That is the mistake that costs money: the format is right, the numbers are wrong.

Banks solved this long ago with check digits. Most domestic bank numbers are built so that a calculation over the digits gives a fixed result. Change one digit, or swap two, and the calculation no longer adds up. The same idea protects card numbers and IBANs. If your form runs that calculation before it accepts the details, most typing mistakes never reach your bank.

Where bank detail forms are used

Bank details turn up in more forms than you might expect, and each one has its own cost when a number is wrong:

  • Direct debit and membership sign-ups: clubs, gyms, schools and charities collect a sort code and account number for a regular collection. A wrong digit means a failed first collection and a member who thinks they have paid.
  • Payroll and new starter forms: HR collects the account a salary goes into. A mistake here means a late salary and an urgent manual payment.
  • Supplier and freelancer set-up: accounts teams collect payment details once and pay invoices for years. A wrong routing number sends a payment back days later.
  • Refunds, grants and expense claims: one-off payments to people who are not customers yet, often from abroad, where the visitor is unsure which number goes where.

All of these forms are filled in once and then trusted for a long time, which is exactly why a check at the moment of typing pays off. The person who knows the right number is in front of the form right now; a week later they are hard to reach.

What happens when the form is sent

It helps to know the order of events, especially if you connect the form to other tools. When the visitor presses the button, Gravity Forms validates every field on the page. The Bank Details field removes spaces and dashes, picks the rules for the chosen country and runs the check on your server. If the check fails, the form comes back with the message under the field and nothing is stored, so no feed, notification or webhook runs for the bad details. If it passes, the numbers are saved in their standard form, the entry records the check that was made, and only then do your notifications, feeds and confirmations run. The masked account number in those messages is the same in every one of them, so a confirmation page and an e-mail never disagree.

How the checks work in each country

UK sort code and account number (modulus checking)

In the UK the check covers the sort code and the account number together. A published weight table lists sort code ranges; for each range it gives a method (standard modulus 10, standard modulus 11 or double alternate) and a weight for each of the 14 digits. Some ranges need two checks and some have exceptions, such as building society accounts or accounts that moved between banks. The table changes several times a year as banks open, close and merge sort codes, so a form that checks UK accounts needs the current table, not a copy from two years ago.

US routing numbers

The 9-digit ABA routing number ends in a check digit. Multiply the digits by 3, 7 and 1 in turn, add them up, and the total must end in zero. The first two digits also fall into ranges set by the Federal Reserve. Account numbers have no public check digit, so only their length can be checked.

Here is the calculation worked through for 011000015, the routing number the Federal Reserve Bank of Boston publishes for itself. Take the digits in groups of three and multiply them by 3, 7 and 1: (0 × 3) + (1 × 7) + (1 × 1) gives 8, (0 × 3) + (0 × 7) + (0 × 1) gives 0, and (0 × 3) + (1 × 7) + (5 × 1) gives 12. The total is 20, which ends in zero, so the number passes. Now change the last digit to 6 and the total becomes 21: the check fails, and the visitor is asked to look at the number again before the form is sent. Swapping two neighbouring digits changes the total in the same way, which is why this simple sum catches most of the mistakes people make when they copy a number from a cheque or a banking app.

New Zealand account numbers

A New Zealand account number has four parts: bank, branch, account and suffix, as in 12-3456-1234567-00. Inland Revenue publishes the check-digit method for each bank; some methods include the suffix, some fold the products into single digits first. One wrong digit anywhere in the number makes the check fail.

Australia and Canada

Australian BSBs and Canadian transit and institution numbers have no public check digit. The best a form can do is make sure the parts have the right number of digits, which still catches a missing or extra digit.

Setting it up in Gravity Forms

The Gravity Forms Bank Details Validator add-on puts these checks into one field. Here is a complete set-up for a swimming club that collects monthly membership fees by direct debit and pays its coaches and suppliers by bank transfer.

Step 1: load the current UK files

Go to Forms → Bank Details. Upload the two UK modulus files (the weight table and the sort code substitution table) from Vocalink’s modulus checking page, or click Fetch from Vocalink to let your site download them. Each line is checked before the files are stored, and the page shows how many rows are loaded and when. Try a sort code and account number in the Try bank details box to see the check working.

Vocalink publishes a new version of the files several times a year, and the file addresses change with each version. When a new version appears, open Vocalink’s modulus checking page, copy the two new addresses into the boxes on the Bank Details page and click the fetch button again, or download the files yourself and upload them. The status table shows the date the files were loaded, so anyone on your team can see at a glance whether the check is up to date. If you never load the files, UK details still get the format check: six digits for the sort code and an account number of the right length.

Forms, Bank Details: the UK modulus checking panel with the weight table and sort code substitutions loaded (rows, date and file), the Upload the files and Fetch from Vocalink boxes, and the Try bank details box showing
Forms → Bank Details: load the current UK modulus files, then try any bank details.

Step 2: add the Bank Details field

In the form editor, add Bank Details from Advanced Fields. For the membership direct debit form, tick only United Kingdom: the visitor sees an account holder name, a sort code and an account number, with no country menu. For the supplier form, tick all five countries and the account type option, so a coach in Auckland or a pool supplier in Ohio sees the labels they know: Bank and branch, or Routing number.

The form editor sidebar for a Bank Details field: bank account countries United Kingdom, United States, Canada, Australia and New Zealand ticked, the country selected first, and the options for the account holder name, the account type and showing only the last 4 digits
Per field: the countries you accept, the holder name, the account type and masking.

Step 3: test with a wrong digit

Open the form, type a sort code and change one digit of a valid account number. The form stops with a clear message under the field, and nothing is saved. Correct the digit and the form goes through. US routing numbers and New Zealand numbers also show a hint as soon as the visitor leaves the box, so most mistakes are fixed before the visitor even presses the button.

A Membership direct debit form with member name, email, the Bank details field (account holder name, sort code 08-99-99 and account number) showing the message
A sort code and account number that do not belong together are refused on your server, before the form is sent.

Step 4: check the entry and the e-mails

The entry stores the details in a standard form (08-99-99 and an 8-digit account number) and records which check was made: UK modulus, check digit or format. Your office notification with {all_fields} shows the account number as ••••4958, so a forwarded e-mail does not spread the full number. For the finance team, add :unmasked to the account number merge tag in a separate internal notification. Staff see the full number on the entry screen.

A Gravity Forms entry with the Bank details field (account holder, country, sort code 08-99-99 and the full account number for staff) and the Bank details check box on the side saying United Kingdom: UK modulus check passed
Staff see the full number on the entry screen, with the check that was made.

Masking, e-mails and CSV exports

Bank details travel further than most form data. A notification is forwarded, a confirmation is printed, an entry list is shown on a screen in a busy office. That is why the field shows only the last four digits of the account number in the entry list, in {all_fields} and in the account number merge tag. The sort code, routing number or BSB stays visible, because staff often need it to recognise the bank.

The people who process payments still need the full number. They can open the entry, where it is shown in full, or receive an internal notification that uses the :unmasked modifier. Entry exports to CSV contain the full number too, because exports are normally made to prepare a payment or a mandate file. Treat those files with care: give the export permission only to the staff who need it, store the files somewhere access is controlled, and delete them once the payment run is done.

Good practice for bank detail forms

  • Ask for the account holder name: mandates and payroll files usually need it, and it helps your team spot a member who typed a parent’s account.
  • Keep the masking on and send the full number only to the people who process payments.
  • Reload the UK files when a new version is published, so new sort codes are checked with their rules instead of the format check.
  • Tell visitors why you ask: a short description under the field (“The account the monthly fee is collected from”) answers most questions.
  • Use your usual entry retention settings for forms with bank details, and limit who can view those entries.
  • Remember what a check can and cannot do: it catches typing mistakes, it does not show that an account exists or who holds it.

Frequently asked questions

Does the add-on contact banks?

No. Every check runs on your own server with published rules. The only download is the UK file update when an administrator clicks the button.

Can the form take IBANs as well?

Use the IBAN Validator add-on for IBANs. Both fields can sit on the same form, for example a domestic account for UK members and an IBAN for members abroad.

What if a UK sort code is not in the table?

The rules say such details cannot be checked and should be accepted, so the add-on accepts them with the format check and records that in the entry.

Does it work with multi-page forms and AJAX forms?

Yes. The check runs when the page with the field is sent, and the hints work on every page.

Does it compare the name with the account?

No. Matching the account holder name to the account is a service only banks and their partners offer. The add-on checks the numbers; the name is collected and stored with them so your team or your payment provider can use it.

Troubleshooting

A visitor says their correct UK account is refused

First check the Bank Details page: if the files were loaded many months ago, a new sort code may have been added or changed since then. Load the current files and try the same details in the Try bank details box. If they still fail, ask the visitor to copy the numbers again from a bank statement rather than from memory; a swapped pair of digits is by far the most common cause.

The Fetch from Vocalink button shows an error

Some hosting companies block outgoing connections from WordPress. Download the two files on your own computer from Vocalink’s page and use the upload box instead; the result is the same. Also make sure the addresses in the boxes are the current ones, because old addresses stop working when a new version is published.

The hint does not appear while typing

The hints are a convenience; the real check always runs on your server when the form is sent. If a caching or script optimisation plugin delays or combines scripts, exclude the add-on’s field script from it and clear the cache.

A New Zealand or UK account only gets the format check

That is expected for banks without a published rule, for UK sort codes missing from the table and for 9 or 10 digit UK account numbers. The entry records that only the format was checked, so your team knows which details to look at more closely.

Get started

The Gravity Forms Bank Details Validator add-on works with Gravity Forms 2.8 and newer. The setup guide covers every setting, the country rules and the merge tags in detail. Load the UK files, add the field and send a test with a wrong digit; it takes a few minutes. See the add-on and its plans.

0
0
Your Cart
Your cart is emptyReturn to Shop
🔥 FREQUENTLY BOUGHT TOGETHER
Complete Combo & Save 40%!
ITEM IN YOUR CART
Gravity Forms Klaviyo Add-on
$39.00/yr
+
🎁 RECOMMENDED ADD-ON SAVE 40% OFF
Original Price: $39.00/yr
Bundle Special Price: $23.40/yr