If you have the 18 digit Id and want to get the 15 digit Id, simply remove the final three characters.
I recommend you read through this Knowledge Article:
Unique Record IDs in Salesforce
Description
Every Record, regardless of entity type, has a globally unique identification value in its ID field which is generated at the time of record creation. That Record ID value will never change, even if the record is deleted and then undeleted.
The URL of a record viewed within Salesforce via web browser contains the Salesforce instance and the Record ID.
For example: http://na1.salesforce.com/5003000000D8cuI
Record ID: 5003000000D8cuI
Instance: na1
Record ID format returned via API
Note: API access requires Enterprise Edition or Unlimited Edition.
API versions prior to 2.0
The ID of a record is always 15-characters and case-sensitive. It should not be compared in a case-insensitive manner.
API versions 2.0 and higher
The API can return either a case-sensitive or a case-insensitive ID field value.
The case-insensitive ID is identical to the 15-character case-sensitive ID, but with 3 extra characters appended to indicate the casing of each of the original 15 characters.
When inserting or updating records, the API accepts either the 15-character case-sensitive ID or the 18-character case-insensitive ID.
When querying or searching records using the API, you must specify a value of "1" for the "useCaseSafeIDs" parameter to indicate that you want the API to return case-insensitive IDs. If you don't specify the "useCaseSafeIDs" parameter, you automatically receive case-sensitive IDs.
API version 2.5
The API defaults to 18 characters on the ID (case-insensitive) and provides no option to use the 15-character case-sensitive ID explicitly.
The "Reports" tool queries the database directly and therefore returns a 15-character case-sensitive ID. Tools like the Data Loader, Demand Tools, or the Weekly Data Export service will export records with the 18-character ID.
You'll find this info under 'Field Types - ID Field Type.'
- ID fields in the Salesforce user interface contain 15-character, base-62, case-sensitive strings. Each of the 15 characters can be a numeric digit (0-9), a lowercase letter (a-z), or an uppercase letter (A-Z). Two unique IDs may only be different by a change in case.
- Because there are applications like Access which do not recognize that 50130000000014c is a different ID from 50130000000014C, an 18-digit, case-safe version of the ID is returned by all API calls. The 18 character IDs have been formed by adding a suffix to each ID in the Force.com API. 18-character IDs can be safely compared for uniqueness by case-insensitive applications, and can be used in all API calls when creating, editing, or deleting data.
- If you need to convert the 18-character ID to a 15-character version, truncate the last three characters. Salesforce recommends that you use the 18-character ID.
18-character Record IDs are just case-insensitive. For example, if you fire a SOQL query for Record ID "00330000000xEftMGH" and "00330000000xEftmgh," the latter will return no results. This means that they are case-sensitive in Salesforce. When used with tools like Excel or Access, you can devise methods to produce case-insensitive IDs.