Washington Sales Tax Rate library (source code)

The Washington Sales Tax Rate Library (WSRL) source code provides a sales tax rate lookup feature using the Department of Revenue's downloadable address and rate files. Its purpose is to provide a means of looking up tax rates using our downloadable files and can be used as a starting point for adding destination-based sales tax rate lookups to your application. For web applications such as shopping carts, you will need to develop a rate lookup service or extend the library to use a disk-based indexing scheme.


  • The following data files are required:
    • address file
    • ZIP+4 file short version
    • rate file

    Note: These files are available on our Download Sales Tax GIS Data page.

  • NUnit, a test framework used by the library, is also required. NUnit can be downloaded and installed at http://nunit.org/documentation/.


Follow these steps to add the library to your Microsoft Visual Studio solution:

  1. From the File menu, add the library project to your solution by choosing File->Add->Add Existing Project.
  2. Navigate to the directory containing the WaRateFiles library and select the project file.
  3. In the Solution Explorer, right click on your project and select "Add Reference".
  4. Click on the project tab and add the WaRateFiles project.

To use the rate lookup library in your program, add "using WaRateFiles" to the file header. The rate lookup class is constructed as follows:

RateLookup lookup = new RateLookup(addressfileName, ratefileName, zipfileName, RateLookupEngine.STANDARDIZER, useShortcutEval);


addressfileName The path and filename of the address file.
ratefileName The path and filename of the rate file.
zipfileName The path and filename of the ZIP+4 file
RateLookupEngine This enumeration has the values of SCAN, INDEX, or STANDARIZER. For SCAN and INDEX, the input address must be standardized to USPS format.
useShortcutEval If true, the STANDARIZER lookup engine will not fully evaluate an address if all of the data for a ZIP or street have the same location code.

Download WaRateFileLookup

Version 1.05

Size: 832K

The check for available updated database files is now case insensitive.

Version 1.04

Size: 321K

An optimization was made with the file updates check to reduce the number of calls to the file download page.

Version 1.03

Size: 833K

The service will no longer halt if there is a problem with the update thread contacting the DOR GIS data download web page. ZIP codes of the form "-3" now return invalid argument instead of throwing an exception.

Version 1.02

Size: 853K

Fixes bugs related to addresses with trailing single characters, ZIP codes with spaces, and the short cut evaluation configuration settings. See the ChangeLog for details.

Version 1.01

Size: 853K

Although non-standard, unencoding of plus signs "+" to spaces now works. Trailing spaces in the "addr" service URL parameter are now properly discarded.

Version 1.0RC2

Size: 831K

Fixes parsing of addresses like "OLD INLAND EMPIRE HWY", updates the unit tests for quarter 3, and the test applications default to not using "shortcut" rate lookups.

Version 1.0RC1

Size: 848K

The changes in this release are mostly related to the service example. Result codes are more consistent and in some cases additional debugging information is returned. Custom performance counters can be enabled in the app.config file. Server statistic such as up time and requests processed can optional be remotely accessed.

Version 0.6

Size: 842K

Adds automatic download and updating of the address and rate files from our web site.

Version 0.5

Size: 147K

Adds support for the PO box data, some additional logging, and some additional documentation.

Version 0.4

Size: 149K


Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.