I have windows 8.1 and wants to develop custom webparts for a remote sharepoint site. Can i do that using visual studio 2013? I have subscription for sharepoint online portal.
For SharePoint Online, you cannot develop Web parts, but "only" add-ins that may contain App parts.
App parts are used (instanciated on the page) by end-users like Web parts. However, they're technical completely different.
So, to answer your question: yes, you can develop add-ins and App parts remotely from VS2013 on Windows 8.1. You can look here to "get started", but there's a lot of other articles on the Internet about developing SharePoint Online add-ins, App parts and how to setup the dev environment.