Before you start
You'll need the following to hand:
- Your Government Gateway User ID — a 12-digit number HMRC sent when you registered for Self Assessment
- Your Government Gateway password
- Your National Insurance number (NINO) — in the format AB 12 34 56 C
- Your Unique Taxpayer Reference (UTR) — 10 digits, found on any HMRC letter or your online Self Assessment 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
-
1Open HMRC settings in MarginIn Margin, click Settings in the left sidebar, then select the Integrations tab. Under the "HMRC / MTD" section, click Connect to HMRC.
-
2Sign in to Government GatewayA browser window opens on the official HMRC Government Gateway page. Enter your 12-digit User ID and password, then click Sign in.
-
3Complete multi-factor authentication (if prompted)HMRC may send a one-time code to your phone or email. Enter the code to continue.
-
4Grant authority to MarginHMRC shows a "Grant authority" screen listing what Margin is requesting access to — specifically the ability to submit Income Tax quarterly updates. Click Grant authority.
-
5Return to MarginClose the browser window. Margin detects the completed authorisation within a few seconds and updates the status to Connected.
-
6Enter your National Insurance numberIf 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:
- Checking the confirmation email HMRC sent when you registered for Government Gateway
- Logging into gov.uk/log-in-register-hmrc-online-services — it will be shown on your profile page once logged in
- Calling HMRC's Self Assessment helpline on 0300 200 3310
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 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:
- Submit quarterly updates to HMRC automatically (if auto-filing is enabled)
- Check your MTD obligations and show upcoming deadlines in the dashboard
- Retrieve your period data from HMRC to pre-populate returns
The HMRC connection token lasts 18 months. Margin will notify you when it needs refreshing.