We present linear-time lexicographic ranking and unranking algorithms for permutations and k-permutations.