Can I copyright software code?

Yes, software code can be copyrighted. Copyrighting only protects the literal work of art, and copyrighting software would thus only protect your code “as-is.” That means, if someone steals your exact code (as in copy-paste) to make it part of their own then you may have rights to sue the infringer of your copyright.

However, if you want to generally protect your idea (regardless of how you wrote the code), you should consider augmenting your protection with a software patent application. A software patent application can be filed in conjunction with a copyright.