How to convert CSV to Membership 2 Pro JSON format?

How should the CSV file be structured and is there any converter or any other way to convert such file to the JSON format required by Membership 2 Pro for import, so data from CSV could be imported to Membership 2 Pro?