From GameBrew

Last Updated2022/03/18
TypeHack Utilities

PKHeX is an open-source save file editor for the main series of Pokémon games, allowing you to transfer Pokémon data between saves, customize them to your liking, and much more.

User guide

PKHeX expects save files that are not encrypted with console-specific keys. Use a savedata manager to import and export savedata from the console (Checkpoint, save_manager, JKSM, or SaveDataFiler).

Supported files

  • Save files ("main", *.sav, *.dsv, *.dat, *.gci, *.bin).
  • GameCube Memory Card files (*.raw, *.bin) containing GC Pokémon savegames.
  • Individual Pokémon entity files (.pk*, *.ck3, *.xk3, *.pb7, *.sk2, *.bk4).
  • Mystery Gift files (*.pgt, *.pcd, *.pgf, .wc*) including conversion to .pk*.
  • Importing GO Park entities (*.gp1) including conversion to .pb7.
  • Importing teams from Decrypted 3DS Battle Videos.
  • Transferring from one generation to another, converting formats along the way.
  • Data is displayed in a view which can be edited and saved. The interface can be translated with resource/external text files so that different languages can be supported.

Showdown Sets

Showdown sets can be imported and exported for the Pokémon currently loaded to the tabs. Party and Battle Box may only be exported.

To export a showdown set from tabs:

  • Press CTRL-SHIFT-T, or
  • ALT click the Species label, or
  • Tools > Showdown > Export Set to Clipboard.

To import a showdown set to tabs:

  • Press CTRL-T, or
  • CTRL click the Species label, or
  • Tools > Showdown > Import Set from Clipboard.

Exporting Party/Battle Box sets:

  • Click on the "Party" or "Battle Box" label directly above the sprites, or
  • Tools > Showdown > Export Party to Clipboard, or
  • Tools > Showdown > Export Battle Box to Clipboard.

PKHeX's Database

PKHeX is able to create a 'pkmdb' folder and store pkm files from all generations for later use. Consider it like a Pokémon Bank.

  • The Database may be accessed via Tools > Data > Database, or by pressing CTRL-D.
  • Pokémon from the active save file will also appear in the Database.
  • You can search to find certain properties via the options on the right side of the window.

What can you do with the results?

  • View - Loads into the Main window to view all properties, and can be set into the save file.
  • Delete - Can be removed from the database (no undo).

You may additionally use the script command format used by the Batch Editor to do more advanced searching:

  • To access the input region, Tools > Search Settings > Advanced Search or press CTRL-A.
  • Advanced Search filtering is done after the regular GUI filters on the right side are processed.
  • Refer to the Batch Editor tutorial for questions regarding figuring out what to enter.

Transferring between Generations

PKHeX only supports methods of transfer that the games support, emulating the official method of transferring for you.

Transferring can only be done forwards. For example, a pk7 cannot be imported to previous generations. There are multiple ways to accomplish a transfer:

  • Individual Transfer:
    • Open two instances of PKHeX, one with the source save and one with the destination save.
    • Drag and Drop between the two windows.
  • Bulk Transfer:
    • Open the source Save File. At the top of the main window, select Tools > Data > Dump Boxes.
    • You may choose to save to PKHeX's Database, or you may save to a Folder (highly recommend).
    • Open the destination Save File in another instance of PKHeX.
    • Drop the folder of PKM's on the save file.
    • The box contents of the destination save file will be overwritten so that all PKM files have been imported.

Using the Batch Editor

Be cautious when using Batch Editor, because there is no undo:

  • If you modify the contents of a Folder, the changes are permanent to those files.
  • If you modify the contents of a Save File, the changes are permanent unless you re-load the Save File.

The Batch Editor is a powerful tool in which the user can make mass modifications to Pokémon in either their save file or supplied folder. By using the built in 'script builder', you may select from properties to either 'set' them or filter according to its value. There are three types of 'script commands' that may be entered:

  • . - This sets the property of the Pokémon equal to the value.
  • .= - This requires the property to be EQUAL to the value.
  • .! - This requires the property to be NOT EQUAL to the valueIf a 'filter' (=,!) is not satisfied, the Pokémon is skipped.

The script interpreter is smart enough to understand the difference between numbers, strings, and booleans; quotation marks are interpreted literally and should not be used. A hint of the value type is provided beneath the dropdown.

Empty or invalid slots are skipped by default. A slot / file must have a valid Pokémon in order to be modified. Example:


Filters are interpreted first. Even though the "=IsNicknamed=false" appears after the ".Species=7" command, the batch editor will require all filters to be satisfied before any modifications are made. To explain what the above script does, it requires the Pokémon to be in the first box, but not in the first slot, and to be not nicknamed. It then sets the Species ID to 7 (Squirtle).

Batch Editor Special Tricks

  • The Batch Editor window references the PKM that is currently viewed in the editing tabs.
    • If you select a property name, the Batch Editor will indicate whether or not the tabs PKM has that property.
    • If the tabs PKM has that property, the Batch Editor will display the property's current value as well as the data type (number, text, etc).
  • To Randomize a PID, use ".PID=$rand".
  • To Randomize EncryptionConstant, use ".EncryptionConstant=$rand"
  • To Randomize a value within a range, use ".Nature=$x,y" for an inclusive range of [x,y].
  • To make a Pokémon Shiny: use ".PID=$shiny".
  • To copy the Encryption Constant to the PID, use ".EC=PID".
  • To delete a Pokémon, use ".Species=0".
  • To set a date (Met / EggMet), use yyyyMMdd for the string.
    • Example: ".MetDate=20160409" will set the Met Date to April 9th, 2016.
  • Suggestions can be automatically applied for Moves, RelearnMoves, and Met_Location.
    • Example: "Moves=$suggest" will retrieve and apply suggested moves from the legality interpreter, same as if you clicked on the Moves groupbox in the tabs editor.
  • Legality can be used as a filter. Use "=Legal=false" to only modify illegal Pokémon.
  • A full up to date list is available by reading the source code (BatchEditor.cs, ProcessPKM method).

Remember that certain formats/generations do not always have future properties. There are many applications of the Batch Editor including mass hatching, deleting, making everything shiny, or clearing EVs from all applicable Pokémon.


Q. Is PKHeX available for the Macintosh OS or Linux?

No. You can use software like Wine/Mono to run it on these operating systems, however the program may not function as intended.

Q> My Pokémon won't work on WiFi battles or can't be traded. Why?

This is usually a Pokémon legality issue. These problems aren't dealt with in the PKHeX subforum; see the announcement regarding cheating online.

Q. What is the Mystery Gift "Received List"?

Every Gift has a unique ID associated with it. When you receive a Mystery Gift the game flags your save file as having obtained the gift, and doesn't allow it to be obtained again.

PKHeX will set the used IDs for you; an ID can be deleted by right clicking the ID and choosing to "Delete".

Q. Can PKHeX create backups automatically?

Yes, create a "bak" folder in the same location as the executable, and PKHeX will export a backup of every new save you load.

Q. (Gen 7, 6) Is PKHeX compatible with Powersaves or Sky3DS?

No. It never will be. Save files must be decrypted in order to load & save, and must be resigned before put back into your cart data.

Q. (Gen 5, 4, 3) I'm using a flash card (R4, Acekard, etc) or emulator and my save file isn't able to be loaded. What's going wrong?

Make sure the save data is in 4 megabit format (512KB) for Gen4/5 games, and 128KB flash for Gen3 games.

Q. (Gen 2, 1) Does PKHeX support these games?

Yes Be sure you are exporting your save file in the "Battery" format (raw save file, not emulator specific).

Useful links


pkhex3.png pkhex4.png

pkhex7.png pkhex8.png

pkhex5.png pkhex6.png


How To Use PKHeX - Official Tutorial (2022) Sword/Shield/BDSP/Legends Arceus (KlutchxGaming)

Known issues

GNU/Linux is not the main Operating System of developers of this program so there may be bugs; some may come from non GNU/Linux specific code of Mono/Wine, so other users may not be able to reproduce the error you are experiencing.



  • Added support for BDSP v1.3 save data format.
  • Legality:
    • Added: Experience above level 100 is now checked.
    • Fixed: PLA Massive Mass Outbreak now correctly identify Overqwil/etc evolutions captured directly in the wild.
  • Added: Batch editor can now copy properties using * -- for example, .PID=*EncryptionConstant will copy the EC to PID.
  • Added: Sprites now
  • Added: SWSH Trainer Editor button to unlock all Isle of Armor Diglett.
  • Fixed: Gen7 Poké Bean editor now reads data correctly.
  • Fixed: Showdown Set imports no longer max PP Ups for PLA imports.

Release notes.


PKHeX's QR code generation code is taken from QRCoder, which is licensed under the MIT license.

PKHeX's shiny sprite collection is taken from pokesprite, which is licensed under the MIT license.

PKHeX's Pokémon Legends: Arceus sprite collection is taken from the National Pokédex - Icon Dex project and its abundance of collaborators and contributors.

External links