en-US windows computer

Maximum PIN length

Verified with Windows 11 25H2 — updated on July 10, 2026

Windows 11 25H2

Supported on: At least Windows 10

Path in the GPO console

Computer Configuration\Administrative Templates\System\PIN Complexity

Description

Maximum PIN length configures the maximum number of characters allowed for the PIN. The largest number you can configure for this policy setting is 127. The lowest number you can configure must be larger than the number configured in the Minimum PIN length policy setting or the number 4, whichever is greater. If you configure this policy setting, the PIN length must be less than or equal to this number. If you disable or do not configure this policy setting, the PIN length must be less than or equal to 127. NOTE: If the above specified conditions for the maximum PIN length are not met, default values will be used for both the maximum and minimum PIN lengths.

Registry

HKLM SOFTWARE\Policies\Microsoft\PassportForWork\PINComplexity

More options available

Options

Maximum PIN length
MaximumPINLength decimal - range 4-127

Export Builder

BETA

Configure the state, scope and options, then generate .reg, PowerShell, Intune and SCCM outputs — or add the setting to a multi-setting collection.

These exports write the registry — this is not a managed GPO.

.reg file

Windows Registry Editor Version 5.00

; Exported from gporais.com
; Policy: Maximum PIN length
; State: Enabled
; Supported on: At least Windows 10

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\PassportForWork\PINComplexity]
"MaximumPINLength"=dword:00000004
More formats (PowerShell, Intune, SCCM)

PowerShell

# Exported from gporais.com
# Policy: Maximum PIN length
# State: Enabled
# Supported on: At least Windows 10

$path = 'HKLM:\SOFTWARE\Policies\Microsoft\PassportForWork\PINComplexity'
New-Item -Path $path -Force | Out-Null
Set-ItemProperty -Path $path -Name 'MaximumPINLength' -Value 4 -Type DWord

Building a multi-setting collection? Add this setting and generate combined .reg / PowerShell / GPO scripts.

Open the Builder

Embed this policy on your site

What to embed
Theme

Adds one script line: the theme follows your site’s appearance and the height fits the content. If your site blocks scripts, the embed follows the visitor’s system theme.

Preview