The Shulchan Arukh's definitive halakhic code for conversion: it covers immersion requirements, the beit din's role, informing the convert of mitzvot, and the status of conversions performed not fully according to law, along with the Rema's Ashkenazic glosses.
כיצד מגיירין הגר והגיורת ודיני קדושת הגר. ובו י"ב סעיפים: גר שנכנס לקהל ישראל חייב מילה תחילה ואם מל כשהיה עובד כוכבים (או שנולד מהול) (טור בשם הרא'"ש) צריך להטיף ממנו דם ברית ואין מברכין עליו ואם נכרת הגיד אין מילתו מעכבת מלהתגייר וסגי ליה בטבילה. (טבל קודם שמל מועיל דבדיעבד הוי טבילה) (ב"י בשם הרמב"ן וכ"כ המ"מ פי"ד מהל' א"ב) (וי"א דלא הוי טבילה) (נ"י פרק החולץ בשם הרא"ה): כשבא להתגייר אומרים לו מה ראית שבאת להתגייר אי אתה יודע שישראל בזמן הזה דחופים סחופים (פי' אבודים וסחופים מן מדוע נסחף אביריך) ומטורפים ויסורים באים עליהם אם אמר יודע אני ואיני כדאי להתחבר עמהם מקבלין אותו מיד ומודיעים אותו עיקרי הדת שהוא יחוד ה' ואיסור עבודת כוכבים ומאריכין עמו בדבר זה ומודיעים אותו מקצת מצות קלות ומקצת מצות חמורות ומודיעים אותו מקצת עונשין של מצות שאומרים לו קודם שבאת למדה זו אכלת חלב אי אתה ענוש כרת חללת שבת אי אתה חייב סקילה ועכשיו אכלת חלב אתה ענוש כרת חללת שבת אתה חייב סקילה ואין מרבין עליו ואין מדקדקין עליו וכשם שמודיעים אותו ענשן של מצות כך מודיעים אותו שכרן של מצות ומודיעים אותו שבעשיית מצות אלו יזכה לחיי העוה"ב ושאין שום צדיק גמור אלא בעל החכמה שעושה מצות אלו ויודעם ואומרים לו הוי יודע שהעולם הבא אינו צפון אלא לצדיקים והם ישראל וזה שתראה ישראל בצער בעולם הזה טובה היא צפונה להם שאינם יכולים לקבל רוב טובה בעוה"ז כעובדי כוכבים שמא ירום לבם ויתעו ויפסידו שכר עולם הבא ואין הקב"ה מביא עליהם רוב פורענות כדי שלא יאבדו אלא כל העובדי כוכבים כלים והם עומדים ומאריכין בדבר זה כדי לחבבן אם קבל מלין אותו מיד וממתינים לו עד שיתרפא רפואה שלימה ואח"כ מטבילין אותו טבילה הוגנת בלא חציצה (וי"א שיגלח שערותיו ויטול צפרני ידיו ורגליו קודם טבילה) (טור ורי"ף ורא"ש) ושלשה (תלמידי חכמים) (ג"ז טור) עומדים על גביו ומודיעים אותו מקצת מצות קלות ומקצת מצות חמורות פעם שניה והוא עומד במים ואם היתה אשה נשים מושיבות אותה במים עד צוארה והדיינים מבחוץ ומודיעין אותה מקצת מצות קלות וחמורות והיא יושבת במים ואח"כ טובלת בפניהם והם מחזירים פניהם ויוצאין כדי שלא יראו אותה כשתעלה מהמים ויברך על הטבילה אחר שיעלה מן המים וכיון שטבל הרי הוא כישראל שאם חזר לסורו הרי הוא כישראל מומר שאם קדש קדושיו קדושין: כל ענייני הגר בין להודיעו המצות לקבלם בין המילה בין הטבילה צריך שיהיו בג' הכשרים לדון וביום (תוס' ורא"ש פ' החולץ) מיהו דוקא לכתחילה אבל בדיעבד אם לא מל או טבל אלא בפני ב' (או קרובים) (הגהות מרדכי) ובלילה אפילו לא טבל לשם גרות אלא איש שטבל לקריו ואשה שטבלה לנדתה הוי גר ומותר בישראלית חוץ מקבלת המצות שמעכבת אם אינה ביום ובשלשה ולהרי"ף ולהרמב"ם אפי' בדיעבד שטבל או מל בפני שנים או בלילה מעכב ואסור בישראלית אבל אם נשא ישראלית והוליד ממנה בן לא פסלינן ליה:
A convert that enters to join to [the] jewish people is obligated in circumcision. If he was already circumcised when he was a Idol worshipper or he was born circumcised (the Tur quoting the Rosh), its necessary to draw blood from it and not bless on it (the circumcision).And If the organ was destroyed , [the fact that] there isn't circumcision [does not prevent him] from converting and its enough for him [to convert] through immersion [alone]. [If] he immerses before he is circumcised, it is effective, that afther the fact he was immersed and there are those who say that it is not [a valid] immersion. When a person comes to convert, say to him, "What did you see that motivated you to come to convert? If you know that Israel, in this time, that the Jewish people are oppressed, eroded, (The words are from "Why is your strong one overthrown?" -Jer. 46:15) insane, and suffering. If he says, I know this and I will still become a part of your people, receive him immediately and tell him the principles of the faith, that God is one and idol worship is forbidden, and tell him a lot about this, and teach him a few of the lighter mitzvot and a few of the more stringent mitzvot, and teach him about some of the punishments of the mitzvot, as it says, "Before you came to learn this, if you ate the forbidden fat, you would not be punished with excommunication, you transgressed Shabbat and you were not punished with stoning; but now, if you eat forbidden food, you will be punished with excommunication; and if you transgress Shabbat you will be punished with stoning." Don't say too much about this, and don't get too specific either. And when you teach him about the punishment of the mitzvot, also teach him about the rewards of the mitzvot and teach him that in the doing of certain mitzvot that will merit life in the world to come. There isn't a complete righteous person, rather a master of wisdom, that does the mitzvot and understands them. And say to him: "You should know that the world to come is hidden from the righteous, who are Israel. As for what you see that Israel is in distress in this world, because it is not granted them to receive the abundance of good things in this world like other peoples, lest their hearts should be indulged loftily and they should go astray and squander the reward of the world to come. But God didn't bring to them too much destruction, so that they would not observe. Rather, all of the idolators stand. And you explicate this idea so that he feels the dearness of it. If he receives this, circumcise him immediately and wait until he is fully healed, and afterwards, immerse him without a barrier. (Some say that you cut or shave his hair and you cut his fingernails and his toenails before immersion.) And three learned scholars stand at his back and teach him some of the light mitzvot and some of the more stringent mitzvot a second time, and he stands in the water. And if it is a woman, women sit her in the water up to her neck and the beit din is outside and they teach her some of the easy mitzvot and some of the more stringent mitzvot and she sits in the water and afterwards, she immerses before them and they turn their faces and leave in order that they do not see her when she is getting out of the water, and they bless the immersion after she comes out of the water. And once he has immersed, it is as if he is a Jew, but if he goes astray, he is like an apostate Jew - he is still sanctified, and his marriage is sanctified. All matters of the convert from making known to them the mitzvot, receiving them, the circumcision and the immersion, it must be with three who are fitting to judge, and during the day. But after the fact if he only was circumcised or immersed at night or in front of relatives [which is invalid], or even if one did not dunk with the intention of conversion, rather a man who dunked for a seminal emission, or a woman who dunked for menstruation, they are still converts and he is permitted to [marry] an Israelite woman. So this all applies to the immersion and the circumcision but it does not apply to receiving the mitzvot, which prevents [conversion] unless it was during the day and in front of three [witnesses]. However, the Rif and the Rambam [say that] even after the fact [one who] immersed or was circumcised before two [witnesses] or at night prevents [conversion], and [marrying] an Israelite woman is forbidden. But, if he is married to an Israelite woman and she has borne him a son, we do not invalidate him [the son].