Pay gap and pay equity analyser

Load a workforce file (or use the invented sample) to see the gender pay gap, a like-for-like comparison, and why the two numbers differ.

Invented data
Drag a CSV file here, or press Enter to choose one

Your file is read by this page on your own computer. Nothing is uploaded or sent anywhere.

What does my file need?
  • One row per employee, with a header row.
  • Required columns: gender, level (or grade/band), job family (or function/department), base salary.
  • Optional: employee ID, and total remuneration (without it, base salary is used for both measures).
  • Optional, each one switches on an extra view: department; WGEA category (one column, or WGEA's separate occupational category and manager category columns); performance rating; time in role (in years); location.
  • WGEA categories accepted by name or code: CEO, KMP, Other executives / General managers (GM), Senior managers (SM), Other managers (OM), Professionals, Technicians and trades, Community and personal service, Clerical and administrative, Sales, Machinery operators and drivers, Labourers.
  • Pay should be annualised full-time-equivalent dollars. Symbols like $ and commas are fine.
  • Gender values accepted: W, F, Woman, Female; M, Man, Male; X, Non-binary, NB, Other.
Pay measure

Groups with fewer than this many women or men are hidden so no individual's pay can be worked out. Sometimes one more group is hidden too, so a hidden figure cannot be worked out by subtracting the others from the total.

Men Women Every bar is also labelled with text.

Gap % = (men's figure − women's figure) ÷ men's figure × 100. A positive gap means men are paid more on average.

People recorded as X are counted in the workforce but are not part of the women-to-men comparison.

Gap by WGEA occupational category

Only gaps are shown here, not average pay, so no one person's pay (the CEO's, for example) can be worked out from the table.

Gap by level

Who is in each pay quarter

Why the two numbers differ

Share of women at each level

Most senior level first (seniority is taken from average pay, highest first). If women are concentrated at the less senior levels, the average gap widens even when pay within each level is similar.

This is a simple breakdown to guide where to look. It is not a statistical test.

General information to help you explore your own data. Not legal advice. All sample data is invented.

'; var blob = new Blob(['' + html], { type: 'application/msword' }); var url = URL.createObjectURL(blob); var a = document.createElement('a'); a.href = url; a.download = 'pay-gap-talking-points.doc'; document.body.appendChild(a); a.click(); document.body.removeChild(a); setTimeout(function () { URL.revokeObjectURL(url); }, 1000); } function renderReport() { var h = ''; state.report.forEach(function (line) { h += '' + esc(line.text) + '

'; }); $('report').innerHTML = h ? '
' + h + '
' : ''; } function renderSource() { var isSample = state.source === 'sample'; $('pillInvented').hidden = !isSample; $('pillFile').hidden = isSample; $('pillFile').textContent = 'Your file: ' + state.fileName; $('btnBack').hidden = isSample; // Department filter: only shown when the file has departments. var depts = []; groupBy(state.rows, function (r) { return r.dept || ''; }).forEach(function (list, d) { if (d) depts.push(d); }); depts.sort(naturalCompare); // A department with too few women or men cannot be viewed on its own. var tooSmall = {}; depts.forEach(function (d) { var s = summarise(state.rows.filter(function (r) { return r.dept === d; }), 'base'); tooSmall[d] = !isBigEnough(s.nW, s.nM, state.min); }); if (depts.indexOf(state.dept) === -1 || tooSmall[state.dept]) state.dept = ''; $('deptCtl').hidden = depts.length === 0; var opts = ''; depts.forEach(function (d, i) { opts += ''; }); $('deptSel').innerHTML = opts; $('deptSel').onchange = function () { state.dept = this.value === '' ? '' : depts[parseInt(this.value, 10)]; render(); }; } var TABS = [['gap', 'tabGap', 'panelGap'], ['lfl', 'tabLfl', 'panelLfl'], ['dept', 'tabDept', 'panelDept'], ['rep', 'tabRep', 'panelRep'], ['talk', 'tabTalk', 'panelTalk']]; function renderTabs() { TABS.forEach(function (t) { var on = state.tab === t[0]; $(t[1]).setAttribute('aria-selected', on ? 'true' : 'false'); $(t[1]).tabIndex = on ? 0 : -1; $(t[2]).hidden = !on; }); // "Why the two numbers differ" belongs with the first two tabs only. $('decompPanel').hidden = state.tab !== 'gap' && state.tab !== 'lfl'; $('measTotal').setAttribute('aria-pressed', state.measure === 'total' ? 'true' : 'false'); $('measBase').setAttribute('aria-pressed', state.measure === 'base' ? 'true' : 'false'); } // Bars start at zero width and grow to their real width (CSS transition does the animation). function animateBars() { requestAnimationFrame(function () { requestAnimationFrame(function () { var els = document.querySelectorAll('[data-w]'); for (var i = 0; i < els.length; i++) els[i].style.width = els[i].getAttribute('data-w') + '%'; }); }); } function render() { renderSource(); renderReport(); renderTabs(); renderGapTab(); renderLflTab(); renderDeptTab(); renderSampleReport(); renderTalk(); renderDecomp(); animateBars(); } /* ===================================================================== 6. LOADING FILES ===================================================================== */ function showMsg(text, cls) { var el = $('loadMsg'); el.innerHTML = text ? '
' + esc(text) + '
' : ''; } // Takes a finished file read and either loads it or asks for a column mapping. function handleText(text, fileName) { var table; try { table = parseCSV(text); } catch (e) { showMsg('Sorry, that file could not be read as a CSV file.'); return; } if (table.length < 2) { showMsg('That file has no data rows. It needs a header row and one row per employee.'); return; } var headers = table[0].map(function (h) { return String(h).trim(); }); var body = table.slice(1); var map = autoMap(headers); var missing = REQUIRED.filter(function (f) { return map[f] === undefined; }); if (missing.length) { state.pending = { headers: headers, body: body, fileName: fileName, map: map }; showMsg(''); renderMapForm(); return; } finishLoad(headers, body, map, fileName); } function finishLoad(headers, body, map, fileName) { var res = buildRows(body, map); if (!res.rows.length) { var why = Object.keys(res.skipped).map(function (k) { return res.skipped[k] + ' where ' + k; }).join('; '); showMsg('No usable rows were found in that file' + (why ? ' (' + why + ')' : '') + '. Check the columns and try again.'); return; } var lines = [{ text: 'Loaded ' + res.rows.length + ' of ' + body.length + ' rows from ' + fileName + '.' }]; var skippedTotal = 0; var parts = []; Object.keys(res.skipped).forEach(function (k) { skippedTotal += res.skipped[k]; parts.push(k + (res.skipped[k] > 1 ? ' (' + res.skipped[k] + ')' : '')); }); if (skippedTotal) { lines.push({ text: plural(skippedTotal, 'row', 'rows') + ' skipped: ' + parts.join('; ') + '.', cls: 'warnline' }); if (res.unknownGender.length) lines.push({ text: 'Gender values not recognised included: ' + res.unknownGender.join(', ') + '.', cls: 'warnline' }); } if (!res.hasTotal) lines.push({ text: 'No total remuneration column was found, so base salary is used for both pay measures.', cls: 'warnline' }); var s = summarise(res.rows, 'base'); if (!s.nW || !s.nM) lines.push({ text: 'This file has no ' + (!s.nW ? 'women' : 'men') + ', so the comparison cannot be made.', cls: 'warnline' }); // Say which optional extras were found, so it is clear which views will work. var extras = [['dept', 'department'], ['cat', 'WGEA category'], ['perf', 'performance rating'], ['tir', 'time in role'], ['loc', 'location']]; var found = extras.filter(function (e) { return hasField(res.rows, e[0]); }).map(function (e) { return e[1]; }); var notFound = extras.filter(function (e) { return !hasField(res.rows, e[0]); }).map(function (e) { return e[1]; }); if (found.length) lines.push({ text: 'Optional columns found: ' + found.join(', ') + '.' }); if (notFound.length) lines.push({ text: 'Not found, so the views that need them are switched off: ' + notFound.join(', ') + '.' }); state.rows = res.rows; state.source = 'file'; state.fileName = fileName; state.hasTotal = res.hasTotal; state.report = lines; state.pending = null; state.dept = ''; $('mapBox').innerHTML = ''; showMsg(''); render(); } function renderMapForm() { var p = state.pending; if (!p) { $('mapBox').innerHTML = ''; return; } var h = '
We could not match every column automatically.' + '

Choose which column in your file holds each item.

'; FIELDS.forEach(function (f) { var optional = REQUIRED.indexOf(f) === -1; h += ''; }); h += '
' + '
'; $('mapBox').innerHTML = h; $('btnUseCols').addEventListener('click', function () { var map = {}, used = {}, problem = ''; FIELDS.forEach(function (f) { var v = $('map_' + f).value; if (v === '') { if (REQUIRED.indexOf(f) > -1) problem = 'Please choose a column for ' + FIELD_NAMES[f].toLowerCase() + '.'; return; } if (used[v]) problem = problem || 'Each item needs its own column.'; used[v] = true; map[f] = parseInt(v, 10); }); if (problem) { showMsg(problem, 'warn'); return; } showMsg(''); finishLoad(p.headers, p.body, map, p.fileName); }); $('btnCancelCols').addEventListener('click', function () { state.pending = null; $('mapBox').innerHTML = ''; showMsg(''); }); } function handleFile(file) { if (!file) return; var name = file.name || 'file'; var lower = name.toLowerCase(); if (/\.xlsx?$|\.xlsm$/.test(lower)) { showMsg('This tool reads CSV files. In Excel choose File > Save As > CSV, then load that file.', 'warn'); return; } if (!/\.(csv|txt)$/.test(lower)) { showMsg('This tool reads CSV files. Please choose a file ending in .csv.', 'warn'); return; } if (typeof FileReader === 'undefined') { showMsg('This browser cannot read files here. Try a recent version of Chrome, Edge, Firefox or Safari.'); return; } var reader = new FileReader(); reader.onload = function () { handleText(String(reader.result || ''), name); }; reader.onerror = function () { showMsg('Sorry, that file could not be opened.'); }; reader.readAsText(file, 'UTF-8'); } function csvCell(v) { var s = String(v); return /[",\r\n]/.test(s) ? '"' + s.replace(/"/g, '""') + '"' : s; } function downloadSample() { var lines = ['employee_id,gender,level,job_family,base_salary,total_remuneration,department,wgea_category,performance_rating,time_in_role_years,location']; SAMPLE.forEach(function (r) { lines.push([r.id, r.gender, r.level, r.family, r.base, r.total, r.dept, CAT_LABEL[r.cat], r.perf, r.tir, r.loc].map(csvCell).join(',')); }); var blob = new Blob([lines.join('\r\n') + '\r\n'], { type: 'text/csv;charset=utf-8' }); var url = URL.createObjectURL(blob); var a = document.createElement('a'); a.href = url; a.download = 'sample-workforce.csv'; document.body.appendChild(a); a.click(); document.body.removeChild(a); setTimeout(function () { URL.revokeObjectURL(url); }, 1000); } /* ===================================================================== 7. EVENTS ===================================================================== */ function setTab(name, focus) { state.tab = name; renderTabs(); animateBars(); if (focus) TABS.forEach(function (t) { if (t[0] === name) $(t[1]).focus(); }); } TABS.forEach(function (t, ix) { $(t[1]).addEventListener('click', function () { setTab(t[0]); }); $(t[1]).addEventListener('keydown', function (e) { if (e.key === 'ArrowRight' || e.key === 'ArrowLeft' || e.key === 'Home' || e.key === 'End') { e.preventDefault(); var n = TABS.length; var next = e.key === 'Home' ? 0 : e.key === 'End' ? n - 1 : (ix + (e.key === 'ArrowRight' ? 1 : n - 1)) % n; setTab(TABS[next][0], true); } }); }); // Like-for-like switches. $('ctlChips').addEventListener('change', function (e) { var key = e.target && e.target.getAttribute('data-ctl'); if (!key) return; state.controls[key] = e.target.checked; render(); var again = $('ctlChips').querySelector('[data-ctl="' + key + '"]'); if (again) again.focus(); }); // Sample report: overtyping an invented figure, or putting them all back. $('wgReport').addEventListener('change', function (e) { var path = e.target && e.target.getAttribute('data-b'); if (!path) return; if (e.target.type === 'text') benchSet(path, e.target.value.trim() || benchGet(path)); else { var v = parseFloat(e.target.value); if (isFinite(v)) benchSet(path, Math.max(-100, Math.min(100, v))); } renderSampleReport(); renderTalk(); // the employer name appears in the talking points too }); $('wgReport').addEventListener('click', function (e) { if (e.target && e.target.id === 'benchReset') { state.bench = defaultBench(); renderSampleReport(); } }); $('measTotal').addEventListener('click', function () { state.measure = 'total'; render(); }); $('measBase').addEventListener('click', function () { state.measure = 'base'; render(); }); $('minGroup').addEventListener('input', function () { var v = parseInt(this.value, 10); if (isFinite(v) && v >= 1) { state.min = v; render(); } }); $('minGroup').addEventListener('change', function () { var v = parseInt(this.value, 10); if (!isFinite(v) || v < 1) { this.value = state.min; } else { this.value = v; state.min = v; render(); } }); $('btnLoad').addEventListener('click', function () { $('fileInput').click(); }); $('fileInput').addEventListener('change', function () { var f = this.files && this.files[0]; handleFile(f); this.value = ''; }); $('btnSample').addEventListener('click', downloadSample); $('btnTalk').addEventListener('click', downloadTalk); $('btnBack').addEventListener('click', function () { state.rows = SAMPLE; state.source = 'sample'; state.fileName = ''; state.hasTotal = true; state.report = []; state.pending = null; state.dept = ''; $('mapBox').innerHTML = ''; showMsg(''); render(); }); var drop = $('dropzone'); drop.addEventListener('click', function () { $('fileInput').click(); }); drop.addEventListener('keydown', function (e) { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); $('fileInput').click(); } }); ['dragenter', 'dragover'].forEach(function (ev) { drop.addEventListener(ev, function (e) { e.preventDefault(); drop.classList.add('over'); }); }); ['dragleave', 'drop'].forEach(function (ev) { drop.addEventListener(ev, function (e) { e.preventDefault(); drop.classList.remove('over'); }); }); drop.addEventListener('drop', function (e) { var files = e.dataTransfer && e.dataTransfer.files; if (files && files.length) handleFile(files[0]); }); // Stop the browser opening a file that is dropped outside the drop zone. window.addEventListener('dragover', function (e) { e.preventDefault(); }); window.addEventListener('drop', function (e) { e.preventDefault(); }); /* ===================================================================== 8. EMBEDDING (iframe height) AND START-UP ===================================================================== */ var lastHeight = 0; function postHeight() { if (window.parent === window) return; var h = Math.ceil(document.body.getBoundingClientRect().height); if (h === lastHeight) return; lastHeight = h; try { window.parent.postMessage({ type: 'wx-tool-height', height: h }, '*'); } catch (e) { /* ignore */ } } if (window.self === window.top) document.documentElement.classList.add('standalone'); render(); // Quick check of the sample numbers (total remuneration, minimum group size 5). (function () { try { var s = summarise(SAMPLE, 'total'), l = likeForLike(SAMPLE, 'total', 5), d = decomposition(SAMPLE, 'total'); console.log('[pay-gap-analyser] sample headline numbers', { employees: SAMPLE.length, meanGapPct: +s.meanGap.toFixed(1), medianGapPct: +s.medGap.toFixed(1), likeForLikeGapPct: l.gap === null ? null : +l.gap.toFixed(1), structurePoints: +d.structure.toFixed(1), similarWorkPoints: +d.similar.toFixed(1), women: s.nW, men: s.nM, x: s.nX }); } catch (e) { /* ignore */ } })(); // The calculation functions, made reachable so the sums can be checked from the browser console. window.wxPayGap = { summarise: summarise, likeForLike: likeForLike, adjustedGap: adjustedGap, categoryTable: categoryTable, departmentTable: departmentTable, payQuarters: payQuarters, parseCSV: parseCSV, autoMap: autoMap, buildRows: buildRows, handleText: handleText, sample: SAMPLE }; if (typeof ResizeObserver !== 'undefined') new ResizeObserver(postHeight).observe(document.body); window.addEventListener('load', postHeight); window.addEventListener('resize', postHeight); postHeight(); })();