Education Template

Square Occupancy Calculator ('Parking')

This is a small JavaScript program that you can use to find the square occupancy for different pieces in a chess game or database of multiple games. The code utilizes the same framework as the LT-PGN viewer PGN2FEN tool (which in turn is built upon LT-PGN viewer code), but unlike the original version this page can handle PGN files and goes further by counting the instances of a particular piece on a particular square throughout the database input provided. All of the resulting data is in a tab-delimited format to facilitate export to excel.

To use this tool, simply paste your input text into the field below and choose the appropriate options. Selecting the correct input type is important, as this program can handle various inputs. For example, as part of the processing it will convert PGN files to FEN (hence the use of hte LT-PGN code), but you can bypass this if you already have a bunch of FEN positions.

If your text is a PGN file that contains line breaks within the game score (breaks between header tags or between games are OK), you should choose the PGN w/ Line Breaks option. If you have PGN text that lacks header tags, you can use PGN w/o Header. If you have FEN text where the digits for empty spaces have been converted to actual spaces, choose FEN-X (expanded FEN) option.

For the output, you can specify the color and piece for which you want square occupancy (parking) data. If you select "All Pieces", data for each piece will be listed in order, followed by the total combination of all these pieces. If you select "Any Piece", only the combination or sum of all pieces will be displayed. Both of these options follow the color selection option as well. Finally, you can select all the resulting tab-delimited text to facilitate copying by using the button at the bottom.


Input Type:

Input Field:



Piece Output:

Select from the list above the subset of results you would like reported in tab-delimited fashion. "All pieces" returns results for each piece as well as a summation (at the bottom). "Any piece" returns only the summation.






Piece Count Per Square




Total processing Time (milliseconds):