Setup Guide

How to connect Margin to HMRC via Government Gateway

5 minutes · Making Tax Digital · MTD ITSA

Connecting Margin to HMRC lets the app submit your quarterly MTD updates automatically. You authorise Margin once through Government Gateway — after that, it handles every submission on your behalf.

Before you start

You'll need the following to hand:

Don't have a Government Gateway account?

You can create one at gov.uk/log-in-register-hmrc-online-services. Choose "Individual" and follow the identity verification steps. HMRC usually sends an activation code by post within 7 days.

Step-by-step: connecting Margin to HMRC

  1. 1
    Open HMRC settings in Margin
    In Margin, click Settings in the left sidebar, then select the Integrations tab. Under the "HMRC / MTD" section, click Connect to HMRC.
  2. 2
    Sign in to Government Gateway
    A browser window opens on the official HMRC Government Gateway page. Enter your 12-digit User ID and password, then click Sign in.
  3. 3
    Complete multi-factor authentication (if prompted)
    HMRC may send a one-time code to your phone or email. Enter the code to continue.
  4. 4
    Grant authority to Margin
    HMRC shows a "Grant authority" screen listing what Margin is requesting access to — specifically the ability to submit Income Tax quarterly updates. Click Grant authority.
  5. 5
    Return to Margin
    Close the browser window. Margin detects the completed authorisation within a few seconds and updates the status to Connected.
  6. 6
    Enter your National Insurance number
    If Margin prompts you, enter your NINO. This links the authorisation to your specific HMRC record and is required before any submission can be made.

Finding your Government Gateway User ID

Your Government Gateway User ID is a 12-digit number — not your email address. HMRC includes it in emails and letters sent when you first enrolled in online services. You can also find it by:

Finding your UTR number

Your Unique Taxpayer Reference (UTR) is a 10-digit number. See our dedicated guide: How to find your UTR number →

MTD ITSA mandation — check your income threshold

MTD for Income Tax applies from April 2026 for income over £50,000 and April 2027 for income over £30,000. If you're not yet mandated, you can still connect early and submit voluntarily.

What happens after you connect

Once connected, Margin can:

The HMRC connection token lasts 18 months. Margin will notify you when it needs refreshing.

Common questions

I don't have a Government Gateway account. Can I still use Margin?
Yes — you can use all of Margin's accounting features without an HMRC connection. You'll only need to connect when you're ready to submit MTD quarterly updates. Create a Government Gateway account at gov.uk first, then come back to connect.
Will Margin file automatically or do I have to approve each submission?
You control this in Settings → MTD / Auto-filing. With auto-filing on, Margin submits at 08:00 on the morning of each deadline — but only if your books pass a completeness check (at least 80% of transactions categorised). If the check fails, Margin holds the filing and shows a warning on your dashboard so you can fix any gaps before the deadline.
Is it safe to give Margin access to my HMRC account?
Margin requests only the specific HMRC API scopes needed to submit Income Tax quarterly updates. It cannot access your tax payments, PAYE records, or personal HMRC correspondence. The connection uses OAuth 2.0 — Margin never sees your Government Gateway password.
My connection keeps failing — what should I do?
Check that your Government Gateway account is enrolled for Self Assessment (Income Tax), not just for PAYE or VAT. If you're enrolled, try clearing your browser cache before retrying. If problems persist, contact Margin support from within the app.

Ready to make MTD effortless?

Connect Margin to HMRC and file quarterly updates automatically — no manual submissions, no missed deadlines.

Start free trial