Go to Settings — More — About device and hit the Build Number until you see Developer mode has been enabled
Hit the Back button, and you will see a new Developer options
Step # 3:
Turn the Developer option ON and then turn on USB debugging
Connect your S4 to your computer with a micro-USB cable, and check the OK button from the pop-up window (Allow USB debugging) from the phone’s screen
Download motochopper, unzip and double-click the run.bat
Link to download the motochopper: Download
*Make sure you have the Samsung Galaxy S4 drivers installed on your computer before you start the run.bat
Hit enter after the run.bat script window pop-up, and then the rooting will begin.
When the rooting is complete press Enter and then your S4 will reboot.
Check the new app in your app drawer called Superuser – if you find the new icon then your mission is complete.
photo credit: link