Quick Answers

What Is a PAC File?

A PAC (proxy auto-config) file is a small JavaScript file that tells a browser which proxy to use for each website, or to connect directly.

By Team of Monkeys Editorial Updated 1 min read Affiliate disclosure

This guide contains affiliate links to Geonode, Webshare, Rayobyte and Proxy Seller. If you buy through them we may earn a commission, at no extra cost to you.

What Is a PAC File illustration: a PAC (proxy auto-config) file is a small JavaScript file that tells a browser which proxy to use for each website, or to connect directly 3jdej38j4

The short answer

A PAC file contains one JavaScript function, FindProxyForURL(url, host), which returns where each request should go:

function FindProxyForURL(url, host) {
  if (dnsDomainIs(host, ".example.com")) return "PROXY 198.51.100.7:8080";
  return "DIRECT";
}

You point your browser or operating system at the file's URL, and it decides per request.

When to use one

Companies use PAC files to send internal sites direct and everything else through a filter. Individuals use them to route only certain sites through a proxy.

Setting the proxy in your browser (animated GIF) 3jdej38j4
Setting the proxy in your browser. GIF via GIPHY

Also known as

Proxy auto-config, proxy.pac, wpad.dat, automatic proxy configuration script.

Ready to put this into practice? Our best proxies in 2026 guide goes deeper, and buy proxies explains what to pay for each type.

Learn more

Affiliate disclosure: Team of Monkeys is an affiliate of Geonode, Webshare, Rayobyte and Proxy Seller. Links and banners marked as sponsored, and links to these four providers in the text, use our referral links, and we may earn a commission if you buy through them, at no extra cost to you. Our explanations and comparisons are written to be useful whichever provider you choose.

Editorial note: Proxy providers change their pools, features and prices often, so treat any figures here as typical ranges at the time of writing and confirm current terms with the provider before you buy.