Ohmforge Gerber & Drill Viewer with DRC-lite
Gerber X2 and Excellon files in – board render, drill table, trace and clearance checks out.
Try an example: Two-layer sensor board: KiCad Gerber X2 ZIP with drill files · Same board in Eagle style (inch, no X2 attributes) with DRC problems · Specification example: two square boxes (pasted Gerber)
How it works
Upload the fabrication data of a printed circuit board – a ZIP of Gerber (RS-274X / X2) layers and Excellon drill files from KiCad, Altium, Eagle, EasyEDA or any CAM tool – and get a rendered board (top and bottom), one SVG per layer with correct dark and clear polarity, the board size from the outline, a drill table per diameter, the narrowest drawn trace, a sampled copper clearance and copper area, and a DRC-lite for annular rings and hole-to-edge distances. Layers are recognised from X2 attributes or file names. A board model with the outline and mounting holes is ready for the enclosure generator.
- Gerber files are read as the Ucamco Gerber Layer Format Specification (2024.05) defines them: format and unit, standard apertures with holes, aperture macros with variables and expressions (primitives 1, 4, 5, 7, 20, 21 and the deprecated 2, 22, 6), linear and circular plotting with G75 (and deprecated G74), regions with several contours, dark/clear polarity, mirroring, rotation and scaling (LM, LR, LS), step and repeat (SR), block apertures (AB) and X2 attributes. Excellon drill files: METRIC/INCH, LZ/TZ or decimal coordinates, tool tables, G85 slots and routed slots.
- Layers are identified by their X2 .FileFunction attribute first, then by KiCad, Altium/Protel, Eagle and EasyEDA file names. Plating comes from X2 attributes, the file name (PTH/NPTH) or Altium comments; a hole of unknown plating without a copper pad on the outer layers counts as non-plated.
- Exact values: board size, area and perimeter from the closed contour of the profile (edge-cuts) layer, measured on the line centres; drill counts per diameter; the narrowest drawn trace (circular-aperture draws and arcs); annular ring = largest inscribed distance of the flashed pad at the hole centre minus the drill radius (smallest over the outer copper layers); hole-to-edge = distance from the hole centre to the outline minus the radius.
- Sampled values: copper is rasterised with dark and clear polarity on a grid (about four million points, at least 0.02 mm). Copper area = copper points inside the outline ÷ outline points. Clearance = smallest gap between separate 8-connected copper islands, found with an exact Euclidean distance transform (Felzenszwalb–Huttenlocher); it is accurate to about one grid step, and islands closer than one step merge.
- Mounting-hole candidates are holes between the two diameters (default 2–4.5 mm, M2–M4 clearance holes); non-plated ones and those within 12 mm of the edge are preselected. The board model moves the outline's lower-left corner to (0, 0) and simplifies the contour to at most 200 points.
A viewer and a quick check, not a fabricator's CAM or a full design-rule check: clearances are sampled on a grid (± one grid step), only flashed pads count for annular rings, and the default rules are typical values. Check your manufacturer's capabilities and review the files in their own viewer before ordering.
Sources
- The Gerber Layer Format Specification, revision 2024.05 (Ucamco)
- Distance Transforms of Sampled Functions (Felzenszwalb and Huttenlocher, Theory of Computing 8, 2012) (Theory of Computing)
- KiCad documentation: Gerber and drill file output (Excellon, X2 attributes) (KiCad project)
- IPC-2221B: Generic Standard on Printed Board Design (annular ring and edge clearance guidance) (IPC)
Part of Ohmforge
-
Ohmforge Virtual electronics workbench
Draw a circuit, switch it on, and measure it with real-feeling bench instruments.
View Gerber and drill files and run a quick board check
Open a ZIP of Gerber X2 and Excellon files, render the board top and bottom, read the board size and drill table, and check trace width, clearance, annular rings and hole-to-edge distances.
What it is for
Before you order a circuit board you want to see what the fabricator will see: the copper, solder mask and silkscreen as they come out of your design tool, the holes, and the board size. This tool opens the fabrication data itself – a ZIP of Gerber layers and Excellon drill files from KiCad, Altium, Eagle, EasyEDA or any CAM tool – renders it and measures it.
You get a board image for the top or bottom side, SVG files of both sides and of every layer, a drill table, the narrowest drawn trace, a sampled copper clearance and copper area, and a short DRC: annular rings of plated holes and the distance from every hole to the board edge. A board model with the outline and the mounting holes is ready for the enclosure generator. It is a quick check, not your fabricator's CAM review.
Worked example
The first example is a 50 × 30 mm two-layer sensor board exported KiCad-style with X2 attributes. All 8 files are recognised from their .FileFunction attribute: outline, top silkscreen, both masks, both copper layers and plated and non-plated drills. The result: 50 × 30 mm, 1496.5 mm² (rounded corners), 18 holes and 1 slot. The drill table lists six 0.3 mm plated vias, eight 1 mm header holes, one 1.2 mm plated slot and four 3.2 mm non-plated mounting holes.
The narrowest trace is 0.25 mm, the smallest annular ring 0.15 mm (0.6 mm via pads on 0.3 mm drills) and the closest hole sits 1.9 mm from the edge. The bottom copper is 88.6 % ground plane, the top 19 %. With the default rules every check passes.
Now tighten the rules to a 0.25 mm clearance and a 0.2 mm annular ring. The summary changes to 9 checks need attention: three pairs of copper islands are about 0.23 mm (± 0.025 mm) apart, and the six vias have rings of 0.15 mm.
The second example is the same board written Eagle-style: inch units, old syntax, no attributes. The layers are recognised from file names such as .cmp and .sol, the board is again 50 × 30 mm, and 7 checks fail: six vias with only 0.05 mm of ring and a hole 0.249 mm from the edge.
How to read the result
Board size comes from the closed contour of the outline layer, measured along the line centres. If there is no closed contour, a warning says the size is only a bounding box.
Detected by tells you whether a layer was identified by an X2 attribute or by its file name. A wrong guess usually means an unusual file name; Ohmforge's viewer lets you change the layer function.
Clearance and copper area are sampled on a grid, shown in the report (0.025 mm here); treat a value within one grid step of your rule as borderline, not as a failure. Trace width, annular ring and hole-to-edge values are exact for drawn traces and flashed pads.
Tips and common mistakes
- Upload the whole ZIP your design tool writes; single files work too, and a separate drill file has its own field.
- Set the four rules to your fabricator's published capabilities; the defaults are typical, not universal.
- A plated hole without a flashed pad is reported. Holes of unknown plating without copper count as non-plated.
- Mounting-hole candidates are holes between 2 and 4.5 mm; change the range if you use M4 or M2 screws.
FAQ
Which Gerber features are supported?
Standard and macro apertures, arcs, regions, dark and clear polarity, step and repeat, block apertures, rotation, mirroring and scaling, X2 attributes and the common deprecated commands of older files.
Why does the clearance differ slightly from my design tool?
It is measured on a raster of the copper, so it is accurate to about one grid step. A smaller sampling grid gives a finer answer.
Does it replace a real DRC?
No. It checks drawn traces, island gaps, rings and edge distances, not nets, drill-to-copper spacing or impedance.
Can I make an enclosure from it?
Yes. Download the board model or the Ohmforge project, or open Instruments → Gerber viewer… in Ohmforge and choose Use the outline for the enclosure.
Guide last updated:
For scripts and AI agents
- JSON API:
POST https://ohmforgegerberviewer.usefulweb.app/api/v1/calculate(same calculation as this page) - Interface description: OpenAPI 3.1 · AI guide: llms.txt
- MCP server (Streamable HTTP):
https://ohmforgegerberviewer.usefulweb.app/mcp· tool nameohmforge_gerber_viewer
Example request
curl -s -X POST https://ohmforgegerberviewer.usefulweb.app/api/v1/calculate \
-H 'content-type: application/json' \
-d '{…see OpenAPI examples…}'